package org.uiautomation.ios.e2e.uicatalogapp;

import org.testng.Assert;
import org.testng.annotations.Test;
import org.uiautomation.ios.UIAModels.UIAElement;
import org.uiautomation.ios.UIAModels.UIATableCell;
import org.uiautomation.ios.UIAModels.predicate.AndCriteria;
import org.uiautomation.ios.UIAModels.predicate.Criteria;
import org.uiautomation.ios.UIAModels.predicate.NameCriteria;
import org.uiautomation.ios.UIAModels.predicate.TypeCriteria;
import org.uiautomation.ios.client.uiamodels.impl.RemoteUIADriver;
import org.uiautomation.ios.client.uiamodels.impl.RemoteUIAWindow;

public class TimeoutTests extends UICatalogTestsBase {


  @Test
  public void getSetTimeout() throws InterruptedException {
    RemoteUIADriver driver = null;
    try {

      driver = getDriver();
      Assert.assertEquals(driver.getLocalTarget().getTimeout(), 0);
      driver.getLocalTarget().setTimeout(17);
      Assert.assertEquals(driver.getLocalTarget().getTimeout(), 17);


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

  @Test
  public void getElement() throws InterruptedException {
    RemoteUIADriver driver = null;
    try {

      String name = "Buttons, Various uses of UIButton2";
      driver = getDriver();
      driver.getLocalTarget().setTimeout(10);
      RemoteUIAWindow win = getMainWindow(driver);
      Criteria c1 = new TypeCriteria(UIATableCell.class);
      Criteria c2 = new NameCriteria(name);
      Criteria c = new AndCriteria(c1, c2);
      System.err.println("START");
      UIAElement element = win.findElement(c);

    } finally {
      System.err.println("END");
      if (driver != null) {
        driver.quit();
      }
    }
  }


}

@@ -1051,24 +1051,26 @@
    %7D%0A  %7D%0A%0A  
+//
 @Test%0A  publ
@@ -1499,43 +1499,8 @@
 2);%0A
-      System.err.println(%22START%22);%0A
     
@@ -1542,17 +1542,16 @@
 ent(c);%0A
-%0A
     %7D fi
@@ -1562,41 +1562,8 @@
 y %7B%0A
-      System.err.println(%22END%22);%0A
     

not a test