Skip to content

Instantly share code, notes, and snippets.

@DominikDary
Created October 21, 2013 06:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DominikDary/7079450 to your computer and use it in GitHub Desktop.
Save DominikDary/7079450 to your computer and use it in GitHub Desktop.
Verification of Selendroid bug #122
/*
* Copyright 2012-2013 eBay Software Foundation and selendroid committers.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package io.selendroid.demo.nativeui;
import io.selendroid.SelendroidCapabilities;
import io.selendroid.SelendroidDriver;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
/**
* Base Test to demonstrate how to test native android apps with Selendroid. App under test is:
* src/main/resources/selendroid-test-app-0.5.1.apk
*
* @author ddary
*/
public class Bug122 {
private WebDriver driver = null;
@Before
public void setup() throws Exception {
driver =
new SelendroidDriver("http://localhost:5555/wd/hub",
SelendroidCapabilities.emulator("io.selendroid.testapp:0.6.0-SNAPSHOT"));
}
@Test
public void assertBug122() throws Exception {
driver.get("and-activity://io.selendroid.testapp.RegisterUserActivity");
driver.getPageSource();
WebElement username = driver.findElement(By.id("inputUsername"));
username.click();
username.sendKeys("user.username");
driver.getPageSource();
driver.findElement(By.linkText("Register User (verify)")).click();
}
@After
public void teardown() {
driver.quit();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment