Overview
MenuBarElement is a Playwright wrapper for the <vaadin-menu-bar> component. It provides utilities to access menu items and open submenus.
Component tag: vaadin-menu-bar
Implements:
HasThemeElementHasStyleElementHasAriaLabelElement
Constructors
MenuBarElement(Page page)
Create aMenuBarElement from the page by locating the first <vaadin-menu-bar> element.
The Playwright page instance
MenuBarElement(Locator locator)
Create aMenuBarElement from an existing locator.
The Playwright locator for the menu bar element
Methods
getMenuItemElement(String name)
Get a menu item by its visible label.The visible label text of the menu item
MenuItemElement - The menu item element with the specified label
openSubMenu(String name)
Click a menu item to open its submenu and return the submenu overlay.The visible label text of the menu item that contains a submenu
MenuElement - The opened submenu overlay
Static Factory Methods
getByLabel(Page page, String label)
Get a menu bar by its accessible label (ARIA label).The Playwright page instance
The accessible label of the menu bar (uses ARIA role MENUBAR)
MenuBarElement - The menu bar with the specified label
Usage Example
Related Elements
- MenuElement - Submenu overlay list
- MenuItemElement - Individual menu items