Package org.uiautomation.ios.UIAModels.predicate

Examples of org.uiautomation.ios.UIAModels.predicate.NameCriteria


  }

  @Test
  public void nameWithParametersZH() {
    ServerSideL10NFactory factory = create(AppleLanguage.zh_Hant);
    NameCriteria c = factory.nameCriteria("footFormat");
    Assert.assertEquals(c.getValue(), "(.*){1}英尺");
  }
View Full Code Here


  }

  @Test
  public void apostrophe() throws JSONException {
    ServerSideL10NFactory factory = create(AppleLanguage.fr);
    NameCriteria c = factory.nameCriteria("detailViewNavTitle");
    Assert.assertEquals(c.getValue(), "Détail de l'apostrophe \" Montagne");
  }
View Full Code Here

  public void getElement() throws InterruptedException {
    driver = getDriver(SampleApps.uiCatalogCap());
    String name = "Buttons, Various uses of UIButton2";

    Criteria c1 = new TypeCriteria(UIATableCell.class);
    Criteria c2 = new NameCriteria(name);
    Criteria c = new AndCriteria(c1, c2);
    long start = System.currentTimeMillis();
    try {
      driver.findElement(c);
      Assert.fail("shouldn't find element" + name);
View Full Code Here

  private static final String buttonsName = "Buttons, Various uses of UIButton";

  @Test
  public void findElementByCriteria() throws InterruptedException {
    Criteria c1 = new TypeCriteria(UIATableCell.class);
    Criteria c2 = new NameCriteria(buttonsName);
    Criteria c = new AndCriteria(c1, c2);
    UIAElement element = driver.findElement(c);
    Assert.assertEquals(element.getName(), buttonsName);
  }
View Full Code Here

  }

  @Test(expectedExceptions = NoSuchElementException.class)
  public void findElementNoResult() throws InterruptedException {
    Criteria c1 = new TypeCriteria(UIATableCell.class);
    Criteria c2 = new NameCriteria("I don't exist.");
    Criteria c = new AndCriteria(c1, c2);
    driver.findElement(c);
    Assert.fail("should have thrown");
  }
View Full Code Here

  }

  @Test
  public void findElementsNoResult() throws InterruptedException {
    Criteria c1 = new TypeCriteria(UIATableCell.class);
    Criteria c2 = new NameCriteria("I don't exist.");
    Criteria c = new AndCriteria(c1, c2);
    List<UIAElement> elements = driver.findElements(c);
    Assert.assertEquals(elements.size(), 0);
  }
View Full Code Here

  }

  @Test
  public void findElementOnElementCriteria() throws InterruptedException {
    UIAApplication app = (UIAApplication) driver.findElement(By.tagName("UIAApplication"));
    UIAElement element = app.findElement(new NameCriteria(buttonsName));
    Assert.assertEquals(element.getName(), buttonsName);
    Assert.assertTrue(element instanceof UIATableCell);
  }
View Full Code Here

  private static final String buttonName = "Buttons, Various uses of UIButton";

  @Test
  public void exactMatch() {
    Criteria c1 = new TypeCriteria(UIATableCell.class);
    PropertyEqualCriteria c2 = new NameCriteria(buttonName);
    Assert.assertEquals(c2.getMatchingStrategy(), MatchingStrategy.exact);
    Criteria c = new AndCriteria(c1, c2);
    UIAElement element = driver.findElement(c);
    Assert.assertEquals(element.getName(), buttonName);
  }
View Full Code Here

  @Test
  public void regexMatch() throws InterruptedException {
    String regex = "Buttons, V[a-z]* uses of UIButton";
    Criteria c1 = new TypeCriteria(UIATableCell.class);
    PropertyEqualCriteria c2 = new NameCriteria(regex, MatchingStrategy.regex);
    Criteria c = new AndCriteria(c1, c2);
    UIAElement element = driver.findElement(c);
    Assert.assertEquals(element.getName(), buttonName);
  }
View Full Code Here

  }

  @Test
  public void positionMatch() {
    Criteria c1 = new TypeCriteria(UIATableCell.class);
    PropertyEqualCriteria c2 = new NameCriteria(buttonName);
    Assert.assertEquals(c2.getMatchingStrategy(), MatchingStrategy.exact);
    Criteria c = new AndCriteria(c1, c2);
    UIAElement element = driver.findElement(c);

    UIARect position = element.getRect();
View Full Code Here

TOP

Related Classes of org.uiautomation.ios.UIAModels.predicate.NameCriteria

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.