Examples of IOSVersion


Examples of org.uiautomation.ios.utils.IOSVersion

    if (capabilities.getSDKVersion() == null) {
      capabilities.setSDKVersion(ClassicCommands.getDefaultSDK());
    } else {
      String version = capabilities.getSDKVersion();

      if (!new IOSVersion(version).isGreaterOrEqualTo("5.0")) {
        throw new SessionNotCreatedException(
            version + " is too old. Only support SDK 5.0 and above.");
      }
      if (capabilities.isSimulator()) {
        if (!server.getHostInfo().getInstalledSDKs().contains(version)) {
View Full Code Here

Examples of org.uiautomation.ios.utils.IOSVersion

    b.append(String.format("\nUsing iOS version %s", hostSDK));

    boolean safari = false;
    // automatically addSafari safari for host SDK and above as instruments starts simulator on host SDK version
    for (String s : driver.getHostInfo().getInstalledSDKs()) {
      IOSVersion version = new IOSVersion(s);
      if (version.isGreaterOrEqualTo("6.0")) {
        safari = true;
        driver.addSupportedApplication(MobileSafariLocator.locateSafariInstall(s));
      }
    }
    if (safari) {
View Full Code Here

Examples of org.uiautomation.ios.utils.IOSVersion

    p(String.format("Using iOS version %s", hostSDK));

    boolean safari = false;
    // automatically add safari for host SDK and above as instruments starts simulator on host SDK version
    for (String s : driver.getHostInfo().getInstalledSDKs()) {
      IOSVersion version = new IOSVersion(s);
      if (version.isGreaterOrEqualTo("6.0")) {
        safari = true;
        driver.addSupportedApplication(MobileSafariLocator.locateSafariInstall(s));
      }
    }
    if (safari) {
View Full Code Here

Examples of org.uiautomation.ios.utils.IOSVersion

  }

  @Test
  public void canParseIncrementamVersion() {
    IOSVersion v7 = new IOSVersion("7.0.3");
    Assert.assertEquals(v7.getMajor(), "7");
    Assert.assertEquals(v7.getMinor(), "0");
    Assert.assertEquals(v7.getIncremental(), "3");

  }
View Full Code Here

Examples of org.uiautomation.ios.utils.IOSVersion

public class IOSVersionTest {

  @Test
  public void canParseBaseVersion() {
    IOSVersion v5 = new IOSVersion("5.0");
    Assert.assertEquals(v5.getMajor(), "5");
    Assert.assertEquals(v5.getMinor(), "0");

  }
View Full Code Here

Examples of org.uiautomation.ios.utils.IOSVersion

    String json = rwe.getAttribute("tree");
    JSONObject tree = new JSONObject(json);
    Assert.assertEquals(tree.getString("type"), "UIAAlert");
    // IOS 6. Alert OK buttons are buttons.
    String version = driver.getCapabilities().getSDKVersion();
    IOSVersion v = new IOSVersion(version);

    By selector;
    if (v.isGreaterOrEqualTo("7")) {
      selector = By.className("UIATableCell");
    } else {
      selector = By.className("UIAButton");
    }
View Full Code Here

Examples of org.uiautomation.ios.utils.IOSVersion

    // check the alert has all its elements
    alert.findElement(UIAStaticText.class, new NameCriteria("UIAlertView"));
    alert.findElement(UIAStaticText.class, new NameCriteria("<Alert message>"));

    String version = driver.getCapabilities().getSDKVersion();
    IOSVersion v = new IOSVersion(version);
    Class type;
    if (v.isGreaterOrEqualTo("7")) {
      type = UIATableCell.class;
    } else {
      type = UIAButton.class;
    }
View Full Code Here

Examples of org.uiautomation.ios.utils.IOSVersion

        // TODO freynaud. 2 windows doesn't mean 2 pages ...
        int delta = getWebDriver().getWindowHandleIndexDifference(pageId);
        if (delta != 0) {
          if (getSession().getApplication().isSafari()) {
            String sdk = getSession().getCapabilities().getSDKVersion();
            String version = new IOSVersion(sdk).getMajor();

            switch (version) {
              case "6":
                getNativeDriver().executeScript(
                    "new SafariPageNavigator().enter().goToWebView(" + delta + ");");
View Full Code Here

Examples of org.uiautomation.ios.utils.IOSVersion

    }
    return true;
  }

  public static File findSafariLocation(File xcodeInstall, String sdkVersion) {
    IOSVersion version = new IOSVersion(sdkVersion);
    String v = version.getMajor() + "." + version.getMinor();
    File safariFolder = new File(xcodeInstall,
                                 "/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator"
                                 + v
                                 + ".sdk/Applications/MobileSafari.app");
    if (!safariFolder.exists()) {
View Full Code Here

Examples of org.uiautomation.ios.utils.IOSVersion

  }


  @Override
  public void setup(){
    if (!new IOSVersion(session.getCapabilities().getSDKVersion()).isGreaterOrEqualTo("8.0")) {
      copySafariToAllowInstallByInstruments();
      setFavorite();
    }

    super.setup();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.