Class MenuElement

java.lang.Object
org.vaadin.addons.dramafinder.element.VaadinElement
org.vaadin.addons.dramafinder.element.MenuElement
All Implemented Interfaces:
Findable<ComponentQuery<MenuElement>>, HasAriaLabelElement, HasLocatorElement, HasStyleElement, HasThemeElement

PlaywrightElement for the menu overlay list <vaadin-menu-bar-list-box>.

The list opens in an overlay at the page root; find(page, MenuElement.class) finds it there once the menu is open.

  • Field Details

  • Constructor Details

    • MenuElement

      public MenuElement(com.microsoft.playwright.Page page)
      Create a MenuElement from the page.
    • MenuElement

      public MenuElement(com.microsoft.playwright.Locator locator)
      Create a MenuElement from an existing locator.
  • Method Details

    • getMenuItemElement

      public MenuItemElement getMenuItemElement(String name)
      Get a menu item by its visible label within this menu.
    • openSubMenu

      public MenuElement openSubMenu(String name)
      Click a menu item to open its submenu and return the next overlay.
    • getByLabel

      @Deprecated(since="2.0.0", forRemoval=true) public static MenuElement getByLabel(com.microsoft.playwright.Page page, String label)
      Deprecated, for removal: This API element is subject to removal in a future version.
      A MenuElement has no visible label: this matches its accessible name. Use find(page, MenuElement.class).withAccessibleName(..) instead. To be removed in 3.0.
      Get the MenuElement by its accessible name (ARIA role menu), searching the entire page.

      The name must match in full, case-sensitively, and no .first() is applied: two matching components fail with a strict-mode error. Use getByLabelContaining(Page, String) to match part of the name.

      Parameters:
      page - the Playwright page
      label - the full accessible name
      Returns:
      the matching MenuElement
    • getByLabelContaining

      @Deprecated(since="2.0.0", forRemoval=true) public static MenuElement getByLabelContaining(com.microsoft.playwright.Page page, String text)
      Deprecated, for removal: This API element is subject to removal in a future version.
      A MenuElement has no visible label: this matches its accessible name. Use find(page, MenuElement.class).withAccessibleNameContaining(..) instead. To be removed in 3.0.
      Get the MenuElement whose accessible name (ARIA role menu) contains text, searching the entire page.

      The name is matched case-insensitively as a substring. No .first() is applied: several matching components fail with a strict-mode error.

      Parameters:
      page - the Playwright page
      text - part of the accessible name
      Returns:
      the matching MenuElement