Class TabsLocator
- All Implemented Interfaces:
Clickable<Tabs>,HasThemeFilter<Tabs,TabsLocator>
Tabs, derived from
TabsTester. 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.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, withAttribute, withAttribute, withClassName, withCondition, withId, withoutAttribute, withoutAttribute, withoutClassNameMethods 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, rightClickMethods inherited from interface com.vaadin.browserless.locator.HasThemeFilter
withoutTheme, withTheme
-
Constructor Details
-
TabsLocator
public TabsLocator() -
TabsLocator
-
-
Method Details
-
getComponent
Description copied from interface:ClickableGets the component being tested.- Specified by:
getComponentin interfaceClickable<Tabs>- 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<Tabs>
-
select
Selects the tab with the given label. Javadoc copied fromTabsTester.select(java.lang.String).- Parameters:
label- the tab label
-
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 fromTabsTester.select(int).- Parameters:
index- the zero-based index of the selected tab, negative value to unselect- 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.
-
isSelected
Checks if the tab with the given label is currently selected. Javadoc copied fromTabsTester.isSelected(java.lang.String).- Parameters:
label- the tab label- Returns:
- true if the tab is selected, false otherwise.
-
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 fromTabsTester.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 browserIllegalArgumentException- if theindexis less than zero or greater than the number of visible tabs.
-
getTab
Gets the visible tab with the given label. Javadoc copied fromTabsTester.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 fromTabsTester.getTab(int).- Parameters:
index- the zero-based index of the selected tab, negative value to unselect- 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.
-