View Javadoc

1   package it.com.atlassian.webdriver.confluence.test;
2   
3   import com.atlassian.pageobjects.browser.Browser;
4   import com.atlassian.pageobjects.page.LoginPage;
5   import com.atlassian.webdriver.confluence.ConfluenceTestedProduct;
6   import com.atlassian.webdriver.confluence.page.DashboardPage;
7   import com.atlassian.webdriver.testing.annotation.IgnoreBrowser;
8   import com.atlassian.webdriver.testing.rule.IgnoreBrowserRule;
9   import com.atlassian.webdriver.testing.rule.SessionCleanupRule;
10  import com.atlassian.webdriver.testing.rule.TestedProductRule;
11  import com.atlassian.webdriver.testing.rule.WebDriverScreenshotRule;
12  import org.junit.Before;
13  import org.junit.Rule;
14  
15  /**
16   */
17  @IgnoreBrowser(value = Browser.HTMLUNIT, reason = "HtmlUnit and Raphael.js don't mix")
18  public abstract class AbstractConfluenceWebTest
19  {
20  
21      @Rule public IgnoreBrowserRule ignoreRule = new IgnoreBrowserRule();
22      @Rule public TestedProductRule<ConfluenceTestedProduct> product =
23          new TestedProductRule<ConfluenceTestedProduct>(ConfluenceTestedProduct.class);
24  // enable TestBrowserRule (and make sure it's listed after IgnoreBrowserRule) if you want to be able to switch browsers mid-suite
25  //    @Rule public TestBrowserRule testBrowserRule = new TestBrowserRule();
26      @Rule public WebDriverScreenshotRule webDriverScreenshotRule = new WebDriverScreenshotRule();
27      @Rule public SessionCleanupRule sessionCleanupRule = new SessionCleanupRule();
28  
29      protected DashboardPage dashboard;
30  
31      @Before
32      public void login()
33      {
34          dashboard = product.visit(LoginPage.class).loginAsSysAdmin(DashboardPage.class);
35      }
36  
37  }