Overview
SideNavigationElement is a Playwright wrapper for the <vaadin-side-nav> component. It provides utilities to manage collapsible navigation menus and access navigation items.
Component tag: vaadin-side-nav
Implements:
HasLabelElement
Constructors
SideNavigationElement(Locator locator)
Create aSideNavigationElement from an existing locator.
The Playwright locator for the side navigation element
Methods
isCollapsed()
Check if the side nav is collapsed. Returns:boolean - True if the side navigation is collapsed
assertCollapsed()
Assert that the side nav is collapsed. Verifies: The element has thecollapsed attribute.
assertExpanded()
Assert that the side nav is expanded. Verifies: The element does not have thecollapsed attribute.
assertCollapsible()
Assert that the side nav is collapsible. Verifies: The element has thecollapsible attribute.
assertNotCollapsible()
Assert that the side nav is not collapsible. Verifies: The element does not have thecollapsible attribute.
getItem(String label)
Get aSideNavigationItemElement by its label text. This searches for a direct or nested vaadin-side-nav-item with the given text.
The label text of the navigation item
SideNavigationItemElement - The navigation item with the specified label
Note: The navigation item must be visible. You may need to expand parent items first.
clickItem(String label)
Click a navigation item by its label.The label text of the navigation item to click
toggle()
Toggle the expansion state of the side navigation. Clicks the label slot to collapse/expand.getLabelLocator()
Get the locator for the side navigation label slot. Returns:Locator - Locator for the [slot='label'] element
Static Factory Methods
getByLabel(Page page, String label)
Get theSideNavigationElement by its accessible label.
The Playwright page instance
The accessible label of the side navigation (uses ARIA role NAVIGATION)
SideNavigationElement - The side navigation with the specified label
Usage Example
Related Elements
- SideNavigationItemElement - Individual navigation items