Search in sources :

Example 1 with Activity

use of io.appium.java_client.android.Activity in project java-client by appium.

the class AndroidTest method replaceValueTest.

@Test
public void replaceValueTest() {
    String originalValue = "original value";
    Activity activity = new Activity("io.appium.android.apis", ".view.Controls1");
    startsActivity.startActivity(activity);
    AndroidElement editElement = driver.findElement(MobileBy.AndroidUIAutomator("resourceId(\"io.appium.android.apis:id/edit\")"));
    editElement.sendKeys(originalValue);
    assertEquals(originalValue, editElement.getText());
    String replacedValue = "replaced value";
    editElement.replaceValue(replacedValue);
    assertEquals(replacedValue, editElement.getText());
}
Also used : Activity(io.appium.java_client.android.Activity) StartsActivity(io.appium.java_client.android.StartsActivity) AndroidElement(io.appium.java_client.android.AndroidElement) Test(org.junit.Test)

Example 2 with Activity

use of io.appium.java_client.android.Activity in project java-client by appium.

the class AndroidTest method setUp.

@Before
public void setUp() {
    startsActivity = new StartsActivity() {

        @Override
        public Response execute(String driverCommand, Map<String, ?> parameters) {
            return driver.execute(driverCommand, parameters);
        }

        @Override
        public Response execute(String driverCommand) {
            return driver.execute(driverCommand);
        }
    };
    Activity activity = new Activity("io.appium.android.apis", ".ApiDemos");
    startsActivity.startActivity(activity);
}
Also used : Response(org.openqa.selenium.remote.Response) Activity(io.appium.java_client.android.Activity) StartsActivity(io.appium.java_client.android.StartsActivity) StartsActivity(io.appium.java_client.android.StartsActivity) Before(org.junit.Before)

Aggregations

Activity (io.appium.java_client.android.Activity)2 StartsActivity (io.appium.java_client.android.StartsActivity)2 AndroidElement (io.appium.java_client.android.AndroidElement)1 Before (org.junit.Before)1 Test (org.junit.Test)1 Response (org.openqa.selenium.remote.Response)1