Package org.uiautomation.ios.client.uiamodels.impl

Examples of org.uiautomation.ios.client.uiamodels.impl.RemoteIOSDriver


  }


  @Test
  public void canSetTimeoutBetween2CommandsWhenProcessingANativeCommand() throws InterruptedException {
    driver = new RemoteIOSDriver(getRemoteURL(), SampleApps.uiCatalogCap());
    Assert.assertEquals(driver.executeScript("return 1;"), 1L);
    try {
      driver.executeScript("UIATarget.localTarget().delay(10);return 1;");
      fail("should have timed out");
    } catch (Exception e) {
View Full Code Here


  @Test
  public void canSwitchToTheWebViewAndFindByCSS() throws Exception {
    IOSCapabilities safari = IOSCapabilities.iphone("UICatalog");
    safari.setCapability(IOSCapabilities.TIME_HACK, false);

    driver = new RemoteIOSDriver(getRemoteURL(), SampleApps.uiCatalogCap());
    Set<String> handles = driver.getWindowHandles();
    Assert.assertEquals(handles.size(), 1);
    UIAElement webCell =
        driver.findElement(new AndCriteria(new TypeCriteria(UIATableCell.class), new NameCriteria(
            "Web", MatchingStrategy.starts)));
View Full Code Here

  }


  @Test
  public void sessionTimeOut() throws InterruptedException {
    driver = new RemoteIOSDriver(getRemoteURL(), SampleApps.uiCatalogCap());
    long started = System.currentTimeMillis();
    long lastCommandStarted = 0;
    try {
      while (true) {
        // check that we can't execute new command after the session has timed out.
View Full Code Here

  //(enabled = false)
  public void nativeWebViewSeesNewPages() throws Exception {
    IOSCapabilities safari = IOSCapabilities.iphone("UICatalog");
    safari.setCapability(IOSCapabilities.TIME_HACK, false);

    driver = new RemoteIOSDriver(getRemoteURL(), SampleApps.uiCatalogCap());
    Set<String> handles = driver.getWindowHandles();
    Assert.assertEquals(handles.size(), 1);
    UIAElement webCell =
        driver.findElement(new AndCriteria(new TypeCriteria(UIATableCell.class), new NameCriteria(
            "Web", MatchingStrategy.starts)));
View Full Code Here

    cap.setDeviceVariation(variation);

    cap.setCapability(LANGUAGE, "en");
    cap.setCapability(LOCALE, "en_GB");
    cap.setCapability(BUNDLE_NAME, "Safari");
    RemoteIOSDriver driver = null;
    try {
      driver = new RemoteIOSDriver(new URL(url), cap);

      for (Orientation o : getOrientationForDevice(device)) {
        driver.rotate(o);
        driver.get(pages.formPage);
        WebElement element = driver.findElement(By.id("working"));

        element.sendKeys("some");
        String value = element.getAttribute("value");
        assertEquals(value, ("some"));

        element.sendKeys(" text");
        value = element.getAttribute("value");
        assertEquals(value, ("some text"));
      }

    } finally {
      if (driver != null) {
        driver.quit();
      }
    }

  }
View Full Code Here

public class ServerSerializeExceptionTest extends BaseIOSDriverTest {

  @Test(expectedExceptions = WebDriverException.class)
  public void clientGetsServerException() {
    IOSCapabilities cap = SampleApps.intlMountainsCap("de");
    driver = new RemoteIOSDriver(getRemoteURL(), cap);
  }
View Full Code Here

  public void canGetSessionsFromServer() throws JSONException, Exception {
    url = getRemoteURL() + "/sessions";

    Assert.assertEquals(getSessions().length(), 0);

    RemoteIOSDriver driver = new RemoteIOSDriver(getRemoteURL(), SampleApps.uiCatalogCap());
    Assert.assertEquals(getSessions().length(), 1);

    JSONObject session = getSessions().getJSONObject(0);
    Assert.assertEquals(session.getString("id"), driver.getSessionId().toString());
    driver.quit();
    Assert.assertEquals(getSessions().length(), 0);
  }
View Full Code Here

    stopDriver();
  }
   
  @Test
  public void canSetAndGetOrientationUsingTheWebDriverAPI() throws MalformedURLException {
    driver = new RemoteIOSDriver(getRemoteURL(), IOSCapabilities.iphone("Safari"));
    WebDriver d = new Augmenter().augment(driver);
    Rotatable rotator = ((Rotatable) d);
    rotator.rotate(LANDSCAPE);
    Assert.assertEquals(rotator.getOrientation(), LANDSCAPE);
    rotator.rotate(PORTRAIT);
View Full Code Here

    Assert.assertEquals(rotator.getOrientation(), PORTRAIT);
  }

  @Test(expectedExceptions = WebDriverException.class)
  public void detectUnsupportedOrientationWithTheWebDriverAPI() throws MalformedURLException {
    driver = new RemoteIOSDriver(getRemoteURL(), SampleApps.uiCatalogCap());
    WebDriver d = new Augmenter().augment(driver);
    Rotatable rotator = ((Rotatable) d);
    Assert.assertEquals(rotator.getOrientation(), PORTRAIT);
    rotator.rotate(LANDSCAPE);
  }
View Full Code Here

    rotator.rotate(LANDSCAPE);
  }

  @Test
  public void canSetAndGetOrientationUsingTheNativeDriverAPI() throws MalformedURLException {
    driver = new RemoteIOSDriver(getRemoteURL(), IOSCapabilities.iphone("Safari"));
    driver.rotate(LANDSCAPE);
    Assert.assertEquals(driver.getOrientation(), LANDSCAPE);

    driver.rotate(Orientation.UIA_DEVICE_ORIENTATION_LANDSCAPERIGHT);
    Assert.assertEquals(driver.getNativeOrientation(),
View Full Code Here

TOP

Related Classes of org.uiautomation.ios.client.uiamodels.impl.RemoteIOSDriver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.