Class SideNavLocator
java.lang.Object
com.vaadin.browserless.locator.Locator<SideNav,SideNavLocator>
com.vaadin.flow.component.sidenav.SideNavLocator
- All Implemented Interfaces:
Clickable<SideNav>,HasThemeFilter<SideNav,SideNavLocator>
@Generated("com.vaadin.browserless.locator.processor.LocatorProcessor")
public class SideNavLocator
extends Locator<SideNav,SideNavLocator>
implements Clickable<SideNav>, HasThemeFilter<SideNav,SideNavLocator>
Generated locator for
SideNav, derived from
SideNavTester. 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 TypeMethodDescriptionvoidclick()Simulates a click on the SideNav label, expanding or collapsing item list.voidSimulates a click on the item that matches the given label.voidEnsures the component is in a usable state before interaction.voidexpandAndClickItem(String topLevelLabel, String... nestedItemLabels) Simulates a click on the item that matches the given label, expanding potential parent collapsed nodes.Gets the component being tested.voidtoggle()Simulates a click on the SideNav toggle button, expanding or collapsing item list.voidtoggleItem(String topLevelLabel, String... nestedItemLabels) Simulates a click on the item that matches 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, withoutClassName, withTestIdMethods 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, middleClick, middleClick, rightClick, rightClickMethods inherited from interface com.vaadin.browserless.locator.HasThemeFilter
withoutTheme, withTheme
-
Constructor Details
-
SideNavLocator
public SideNavLocator()
-
-
Method Details
-
getComponent
Description copied from interface:ClickableGets the component being tested.- Specified by:
getComponentin interfaceClickable<SideNav>- 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<SideNav>
-
clickItem
Simulates a click on the item that matches the given label. For nested navigation item provide the label of each item in the hierarchy. The path to the navigation item must reflect what is seen in the browser, meaning that hidden items are ignored. For the same reason, items inside collapsed nodes cannot be clicked and an exception is thrown. UseexpandAndClickItem(String, String...)to expand intermediate node and click on the desired item.
Javadoc copied fromsideNav.addItem(new SideNavItem("Home", HomeView.class)); SideNavItem childNav = new SideNavItem("Messages"); childNav.addItem(new SideNavItem("Inbox", InboxView.class)); childNav.addItem(new SideNavItem("Sent", SentView.class)); sideNav.addItem(childNav); // clicks top level navigation item with label Home tester.clickItem("Home"); // clicks nested navigation item with label Sent wrapper.clickItem("Messages", "Sent");SideNavTester.clickItem(java.lang.String,java.lang.String[]).- Parameters:
topLevelLabel- the text content of the top level SideNav item label, not null.nestedItemLabels- labels of the nested SideNav items- Throws:
IllegalArgumentException- if the provided text does not identify a SideNav item.IllegalStateException- if the item at given path is not usable.- See Also:
-
expandAndClickItem
Simulates a click on the item that matches the given label, expanding potential parent collapsed nodes. For nested navigation item provide the label of each item in the hierarchy. The path to the navigation item must reflect what is seen in the browser, meaning that hidden items are ignored. For the same reason, items inside collapsed nodes cannot be clicked and an exception is thrown.
Javadoc copied fromsideNav.addItem(new SideNavItem("Home", HomeView.class)); SideNavItem childNav = new SideNavItem("Messages"); childNav.addItem(new SideNavItem("Inbox", InboxView.class)); childNav.addItem(new SideNavItem("Sent", SentView.class)); sideNav.addItem(childNav); // clicks nested navigation item with label Sent wrapper.expandAndClickItem("Messages", "Sent");SideNavTester.expandAndClickItem(java.lang.String,java.lang.String[]).- Parameters:
topLevelLabel- the text content of the top level SideNav item label, not null.nestedItemLabels- labels of the nested SideNav items- Throws:
IllegalArgumentException- if the provided text does not identify a SideNav item.IllegalStateException- if the item at given path is not usable.- See Also:
-
click
public void click()Simulates a click on the SideNav label, expanding or collapsing item list. Javadoc copied fromSideNavTester.click().- Specified by:
clickin interfaceClickable<SideNav>- Throws:
IllegalStateException- if theSideNavcomponent is not collapsible or not usable.- See Also:
-
toggleItem
Simulates a click on the item that matches the given label. For nested navigation item provide the label of each item in the hierarchy. The path to the navigation item must reflect what is seen in the browser, meaning that hidden items are ignored. For the same reason, items inside collapsed nodes cannot be clicked and an exception is thrown. UseexpandAndClickItem(String, String...)to expand intermediate node and click on the desired item.
Javadoc copied fromsideNav.addItem(new SideNavItem("Home", HomeView.class)); SideNavItem childNav = new SideNavItem("Messages"); childNav.addItem(new SideNavItem("Inbox", InboxView.class)); childNav.addItem(new SideNavItem("Sent", SentView.class)); sideNav.addItem(childNav); // clicks top level navigation item with label Home tester.clickItem("Home"); // clicks nested navigation item with label Sent wrapper.clickItem("Messages", "Sent");SideNavTester.toggleItem(java.lang.String,java.lang.String[]).- Parameters:
topLevelLabel- the text content of the top level SideNav item label, not null.nestedItemLabels- labels of the nested SideNav items- Throws:
IllegalArgumentException- if the provided text does not identify a SideNav item.IllegalStateException- if the item at given path is not usable.- See Also:
-
toggle
public void toggle()Simulates a click on the SideNav toggle button, expanding or collapsing item list. Javadoc copied fromSideNavTester.toggle().- Throws:
IllegalStateException- if theSideNavcomponent is not collapsible or not usable.- See Also:
-