Package org.uiautomation.ios.UIAModels.predicate

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


  @Test
  public void or() throws Exception {
    LabelCriteria l = new LabelCriteria("the label");
    ValueCriteria v = new ValueCriteria("the value");
    OrCriteria or = new OrCriteria(l, v);

    JSONObject o = or.stringify();

    OrCriteria c = AbstractCriteria.parse(o);

    Assert.assertEquals(or.getClass(), c.getClass());

  }
View Full Code Here


  @Test
  public void orCriteriaReturnsFirstMatch() {
    Criteria mountain1 = new NameCriteria("Mountain 1");
    Criteria mountain2 = new NameCriteria("Mountain 2");

    UIAElement result1 = driver.findElement(new OrCriteria(mountain1, mountain2));
    UIAElement result2 = driver.findElement(new OrCriteria(mountain2, mountain1));

    Assert.assertEquals(result1.getName(), "Mountain 1");
    Assert.assertEquals(result2.getName(), "Mountain 2");
  }
View Full Code Here

  public void complexOrCriteriaReturnsFirstMatch() {
    Criteria mountain1 = new NameCriteria("Mountain 1");
    Criteria mountain2 = new NameCriteria("Mountain 2");
    Criteria mountain3 = new NameCriteria("Mountain 3");

    UIAElement result1 = driver.findElement(new OrCriteria(mountain1, mountain2, mountain3));
    UIAElement
        result3 =
        driver.findElement(new OrCriteria(new OrCriteria(mountain3, mountain2), mountain1));

    Assert.assertEquals(result1.getName(), "Mountain 1");
    Assert.assertEquals(result3.getName(), "Mountain 3");
  }
View Full Code Here

TOP

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

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.