Package org.uiautomation.ios

Examples of org.uiautomation.ios.IOSCapabilities


    server.start();

    RemoteWebDriver driver = null;

    URL url = new URL("http://localhost:4444/wd/hub");
    IOSCapabilities caps = IOSCapabilities.iphone("Safari");
    driver = new RemoteWebDriver(url, caps);

    HttpClient client = HttpClientFactory.getClient();
    String s = url + "/status";
    URL u = new URL(s);
View Full Code Here


  }

  private static void generate(DeviceType device, DeviceVariation variation) throws Exception {
    RemoteWebDriver driver = null;
    try {
      IOSCapabilities caps = IOSCapabilities.iphone("Safari");
      if (device == DeviceType.ipad) {
        caps.setDevice(DeviceType.ipad);
      }
      caps.setDeviceVariation(variation);

      driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), caps);
      driver.get("http://ebay.ch");
      RemoteIOSDriver d = IOSDriverAugmenter.getIOSDriver(driver);
View Full Code Here

  private static void dumpCapabilities(DeviceType device, DeviceVariation variation,
                                       RemoteIOSDriver d) throws IOException, JSONException {
    String capability =  device + "_" + variation + ".json";
    File base = new File("server/src/test/resources/mock");
    File caps = new File(base, capability);
    IOSCapabilities c = d.getCapabilities();

    FileWriter w = new FileWriter(caps);
    String content = new JSONObject(c.getRawCapabilities()).toString(2);
    w.write(content);
    w.close();
    System.out.println(caps.getAbsolutePath());
  }
View Full Code Here

    return new File(getApplicationPath(),"embedded.mobileprovision");
  }

  @Override
  public IOSCapabilities getCapabilities(){
    IOSCapabilities res = super.getCapabilities();
    try {
      ProvisioningProfileInfo info = ProvisioningService.getProfile(getEmbeddedProfile());
      res.setCapability(IOSCapabilities.PROVISIONNED,info.getDevices());
      return res;
    } catch (Exception e) {
      throw new WebDriverException("Cannot extract probile. corrupted ipa ?");
    }
  }
View Full Code Here

  protected void startDriver(IOSCapabilities caps) {
    // Disable default driver; instead, let each test call "createDriver"
  }

  protected void createDriver(Level performanceLogLevel) throws Exception {
    IOSCapabilities caps = IOSCapabilities.iphone("Safari");
    if (performanceLogLevel != null) {
      LoggingPreferences logPrefs = new LoggingPreferences();
      logPrefs.enable(LogType.PERFORMANCE, performanceLogLevel);
      caps.setCapability(CapabilityType.LOGGING_PREFS, logPrefs);
    }
    super.startDriver(caps);
  }
View Full Code Here

  @Test
  public void testTurningOffLogShouldMeanNoLogMessages() throws Exception {
    Set<String> logTypes = driver.manage().logs().getAvailableLogTypes();
    for (String logType : logTypes) {
      IOSCapabilities caps = IOSCapabilities.iphone("Safari");
      LoggingPreferences logPrefs = new LoggingPreferences();
      logPrefs.enable(logType, Level.OFF);
      caps.setCapability(CapabilityType.LOGGING_PREFS, logPrefs);
      startDriver(caps);
      driver.get(pages.simpleTestPage);
      LogEntries entries = driver.manage().logs().get(logType);
      assertTrue(entries.getAll().isEmpty(),
          String.format("There should be no log entries for " +
View Full Code Here

  }

  @Test
  public void base() {
    driver = new RemoteIOSDriver(getRemoteURL(), SampleApps.uiCatalogCap());
    IOSCapabilities cap = IOSCapabilities.iphone("UICatalog", "2.10");
    String sdk = cap.getSDKVersion();
    if (sdk == null) {
      sdk = ClassicCommands.getDefaultSDK();
    }
    IOSCapabilities actual = driver.getCapabilities();
    Assert.assertEquals(actual.getBundleId(), "com.yourcompany.UICatalog");
    Assert.assertEquals(actual.getBundleVersion(), "2.10");
    Assert.assertEquals(actual.getSDKVersion(), sdk);
  }
View Full Code Here

  @Test
  public void noVersion() {
    driver = new RemoteIOSDriver(getRemoteURL(), SampleApps.uiCatalogCap());

    IOSCapabilities actual = driver.getCapabilities();
    Assert.assertEquals(actual.getBundleId(), "com.yourcompany.UICatalog");
    Assert.assertEquals(actual.getBundleVersion(), "2.10");
  }
View Full Code Here

  }

  @Test
  public void appWithNoContentCanStart() throws Exception {
    driver = new RemoteIOSDriver(getRemoteURL(), SampleApps.noContentCap());
    IOSCapabilities actual = driver.getCapabilities();
    Assert.assertEquals(actual.getBundleId(), "freynaud.testNoContent");
    Assert.assertEquals(actual.getBundleVersion(), "1.0");

    try {
      driver.findElement(By.xpath("//*[@name=l10n('test')]"));
      Assert.fail("cannot use l10n features on an app with no content.");
    } catch (WebDriverException expected) {
View Full Code Here

    }
  }

  @Test
  public void startDefaultLanguageLocale() {
    IOSCapabilities capabilitiesNoLanguageNoLocale;
    capabilitiesNoLanguageNoLocale = SampleConfig.uiCatalogCapNoLangNoLocale();
    driver = new RemoteIOSDriver(getRemoteURL(), capabilitiesNoLanguageNoLocale);
    IOSCapabilities actual = driver.getCapabilities();

    Assert.assertEquals(actual.getBundleId(), "com.yourcompany.UICatalog");
    Assert.assertEquals(actual.getBundleVersion(), "2.10");
    Assert.assertEquals(actual.getLanguage(), "en");
    Assert.assertEquals(actual.getLocale(), "en_GB");
  }
View Full Code Here

TOP

Related Classes of org.uiautomation.ios.IOSCapabilities

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.