View Javadoc

1   package com.atlassian.webdriver.confluence.page;
2   
3   import com.atlassian.pageobjects.Page;
4   import com.atlassian.pageobjects.PageBinder;
5   import com.atlassian.pageobjects.page.WebSudoPage;
6   import org.openqa.selenium.WebElement;
7   import org.openqa.selenium.support.FindBy;
8   
9   import javax.inject.Inject;
10  
11  /**
12   * Confluence WebSudo page
13   */
14  public class ConfluenceWebSudoPage implements WebSudoPage
15  {
16      private static final String URI = "/authenticate.action";
17  
18      @Inject
19      private PageBinder pageBinder;
20  
21      @FindBy(id="password")
22      private WebElement passwordTextbox;
23  
24      @FindBy(id="authenticateButton")
25      private WebElement confirmButton;
26  
27      public String getUrl()
28      {
29          return URI;
30      }
31      
32      public <T extends Page> T confirm(Class<T> targetPage)
33      {
34          return confirm("admin", targetPage);
35      }
36  
37      public <T extends Page> T confirm(String password, Class<T> targetPage)
38      {
39          passwordTextbox.sendKeys(password);
40          confirmButton.click();
41          return pageBinder.navigateToAndBind(targetPage);
42      }
43  
44  
45  }