View Javadoc

1   package com.atlassian.pageobjects.elements.test.pageobjects.page;
2   
3   import com.atlassian.pageobjects.Page;
4   import com.atlassian.pageobjects.PageBinder;
5   import com.atlassian.pageobjects.binder.WaitUntil;
6   import com.atlassian.pageobjects.browser.Browser;
7   import com.atlassian.pageobjects.browser.IgnoreBrowser;
8   import com.atlassian.pageobjects.elements.ElementBy;
9   import com.atlassian.pageobjects.elements.PageElement;
10  import com.atlassian.pageobjects.elements.PageElementFinder;
11  import com.atlassian.pageobjects.elements.query.Poller;
12  import com.atlassian.webdriver.utils.by.ByJquery;
13  
14  import javax.inject.Inject;
15  
16  /**
17   * Represents the elements.html
18   */
19  public class ElementsPage implements Page
20  {
21      @Inject
22      protected PageBinder pageBinder;
23  
24      @Inject
25      protected PageElementFinder elementFinder;
26  
27      @ElementBy(id="test1_addElementsButton")
28      private PageElement test1_addElementsButton;
29  
30      @ElementBy(id="test1_delayedSpan")
31      private PageElement test1_delayedSpan;
32  
33      @Override
34      public String getUrl()
35      {
36          return "/html/elements.html";
37      }
38  
39      @WaitUntil
40      @IgnoreBrowser(value = Browser.HTMLUNIT_NOJS, reason = "Selector is not possible without jQuery")
41      public void waitForTitle()
42      {
43          Poller.waitUntilTrue(elementFinder.find(ByJquery.$("h1:contains(Html Elements Page)")).timed().isPresent());
44      }
45  
46      public PageElement test1_addElementsButton()
47      {
48          return test1_addElementsButton;
49      }
50  
51       public PageElement test1_delayedSpan()
52      {
53          return test1_delayedSpan;
54      }
55  }