View Javadoc

1   package com.atlassian.pageobjects.elements.test.pageobjects.component;
2   
3   import com.atlassian.pageobjects.elements.PageElement;
4   import com.atlassian.pageobjects.components.ActivatedComponent;
5   import org.openqa.selenium.By;
6   
7   /**
8    * Represents the UserTab of the rolestab that is present in the AUIPage.
9    */
10  public class UserTab implements ActivatedComponent<UserTab>
11  {
12      private final String tabTitle = "User Tab";
13      private final UserRoleTabs tabs;
14  
15      public UserTab(UserRoleTabs tabs)
16      {
17          this.tabs = tabs;
18      }
19  
20      public String header()
21      {
22          return getView().find(By.tagName("h4")).getText();
23      }
24  
25      public PageElement getTrigger()
26      {
27          return tabs.selectedTab();
28      }
29  
30      public PageElement getView()
31      {
32          return tabs.selectedView();
33      }
34  
35      public UserTab open()
36      {
37          tabs.openTab(this.tabTitle);
38          return this;
39      }
40  
41      public boolean isOpen()
42      {
43          return tabs.selectedTab().getText().equals(tabTitle);
44      }
45  }