View Javadoc

1   package com.atlassian.webdriver.utils.element;
2   
3   import org.openqa.selenium.By;
4   import org.openqa.selenium.SearchContext;
5   import org.openqa.selenium.support.ui.ExpectedCondition;
6   
7   /**
8    * Factory for element conditions.
9    *
10   * @since 2.2
11   * @see ExpectedCondition
12   */
13  public final class ElementConditions
14  {
15  
16      private ElementConditions()
17      {
18          throw new AssertionError("Don't instantiate me");
19      }
20  
21      public static ElementLocated isPresent(By locator, SearchContext context)
22      {
23          return new ElementLocated(locator, context);
24      }
25  
26      public static ElementLocated isPresent(By locator)
27      {
28          return new ElementLocated(locator);
29      }
30  
31      public static ElementNotLocated isNotPresent(By locator, SearchContext context)
32      {
33          return new ElementNotLocated(locator, context);
34      }
35  
36      public static ElementNotLocated isNotPresent(By locator)
37      {
38          return new ElementNotLocated(locator);
39      }
40  
41      public static ElementIsVisible isVisible(By locator, SearchContext context)
42      {
43          return new ElementIsVisible(locator, context);
44      }
45  
46      public static ElementIsVisible isVisible(By locator)
47      {
48          return new ElementIsVisible(locator);
49      }
50  
51      public static ElementNotVisible isNotVisible(By locator, SearchContext context)
52      {
53          return new ElementNotVisible(locator, context);
54      }
55  
56      public static ElementNotVisible isNotVisible(By locator)
57      {
58          return new ElementNotVisible(locator);
59      }
60  
61  
62  }