Class TabSheetLocator
TabSheet, derived from
TabSheetTester. Filter steps are inherited from
Locator; action methods delegate to a fresh tester
around the resolved component, so behavioral changes belong on the
tester, not here.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidEnsures the component is in a usable state before interaction.Gets the component being tested.getTab(int index) Gets the visible tab at given index.Gets the visible tab with the given label.<E extends Component>
EgetTabContent(int index) Gets the content of the visible tab at given index.<E extends Component>
EgetTabContent(String label) Gets the content of the visible tab with the given label.booleanisSelected(int index) Checks if the visible tab at the given index is currently selected.booleanisSelected(String label) Checks if the tab with the given label is currently selected.voidselect(int index) Selects a visible tab based on its zero-based index.voidSelects the tab with the given label.Methods inherited from class com.vaadin.browserless.locator.Locator
atIndex, component, components, exists, inside, inside, invalidate, self, with, withAriaLabel, withAriaLabelContaining, withAttribute, withAttribute, withCaption, withCaptionContaining, withClassName, withCondition, withId, withLabel, withLabelContaining, withoutAttribute, withoutAttribute, withoutClassName, withoutTheme, withText, withTextContaining, withTheme, withValueMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.browserless.Clickable
click, click, click, middleClick, middleClick, rightClick, rightClick
-
Constructor Details
-
TabSheetLocator
public TabSheetLocator() -
TabSheetLocator
-
-
Method Details
-
getComponent
Description copied from interface:ClickableGets the component being tested.- Specified by:
getComponentin interfaceClickable<TabSheet>- Returns:
- the component under test
-
ensureComponentIsUsable
public void ensureComponentIsUsable()Description copied from interface:ClickableEnsures the component is in a usable state before interaction.- Specified by:
ensureComponentIsUsablein interfaceClickable<TabSheet>
-
select
Selects the tab with the given label. Javadoc copied fromTabSheetTester.select(java.lang.String).- Parameters:
label- the tab label- Throws:
IllegalArgumentException- if the tab with givenlabelis not visible.IllegalStateException- if tab is not usable in the browser
-
select
public void select(int index) Selects a visible tab based on its zero-based index.The
indexrefers to the zero-base position of the currently visible tabs. For example, if there are three tabs A (position 0), B (position 1) and C (position 2), but tab 'B' is hidden, then to select tab 'C' the call must beselect(1)and notselect(2). Javadoc copied fromTabSheetTester.select(int).- Parameters:
index- the zero-based index of the selected tab, negative value to unselect- Throws:
IllegalStateException- if tab at give index is not usable in the browser
-
isSelected
Checks if the tab with the given label is currently selected. Javadoc copied fromTabSheetTester.isSelected(java.lang.String).- Parameters:
label- the tab label- Returns:
- true if the tab is selected, false otherwise.
- Throws:
IllegalArgumentException- if the tab with givenlabelis not visible.
-
isSelected
public boolean isSelected(int index) Checks if the visible tab at the given index is currently selected.The
indexrefers to the zero-base position of the currently visible tabs. For example, if there are three tabs A (position 0), B (position 1) and C (position 2), but tab 'B' is hidden, then to check if tab 'C' is selected the call must beisSelected(1)and notisSelected(2). Javadoc copied fromTabSheetTester.isSelected(int).- Parameters:
index- the zero-based index of the tab- Returns:
- true if the tab is selected, false otherwise.
- Throws:
IllegalStateException- if tab at given index is not visible in the browser
-
getTab
Gets the visible tab with the given label. Javadoc copied fromTabSheetTester.getTab(java.lang.String).- Parameters:
label- the tab label- Throws:
IllegalStateException- if tab is not visible
-
getTab
Gets the visible tab at given index.The
indexrefers to the zero-base position of the currently visible tabs. For example, if there are three tabs A (position 0), B (position 1) and C (position 2), but tab 'B' is hidden, then to get tab 'C', the call must begetTab(1)and notgetTab(2). Javadoc copied fromTabSheetTester.getTab(int).- Parameters:
index- the zero-based index of the selected tab, negative value to unselect- Returns:
- the tab at the given index
- Throws:
IllegalStateException- if tab at given index is not visible in the browserIllegalArgumentException- if theindexis less than zero or greater than the number of visible tabs.
-
getTabContent
Gets the content of the visible tab with the given label. Javadoc copied fromTabSheetTester.getTabContent(java.lang.String).- Parameters:
label- the tab label- Returns:
- the content of the tab with the given label
- Throws:
IllegalStateException- if tab is not visible
-
getTabContent
Gets the content of the visible tab at given index.The
indexrefers to the zero-base position of the currently visible tabs. For example, if there are three tabs A (position 0), B (position 1) and C (position 2), but tab 'B' is hidden, then to get the content of tab 'C', the call must begetTabContent(1)and notgetTabContent(2). Javadoc copied fromTabSheetTester.getTabContent(int).- Parameters:
index- the zero-based index of the selected tab, negative value to unselect- Returns:
- the content of the tab at the given index
- Throws:
IllegalStateException- if tab is not visibleIllegalArgumentException- if theindexis less than zero or greater than the number of visible tabs.
-