Class MenuBarElement

java.lang.Object
com.vaadin.testbench.TestBenchElement
com.vaadin.flow.component.menubar.testbench.MenuBarElement
All Implemented Interfaces:
CanCompareScreenshots, HasCallFunction, HasDriver, HasElementQuery, HasPropertySettersGetters, HasSearchContext, HasTestBenchCommandExecutor, org.openqa.selenium.SearchContext, org.openqa.selenium.TakesScreenshot, org.openqa.selenium.WebElement, org.openqa.selenium.WrapsElement

public class MenuBarElement extends TestBenchElement
A TestBench element representing a <vaadin-menu-bar> element.
  • Field Details

  • Constructor Details

    • MenuBarElement

      public MenuBarElement()
  • Method Details

    • getButtons

      public List<TestBenchElement> getButtons()
      Gets the button elements wrapping the root level items. This does not include the overflowing items which are rendered in a sub menu, nor the overflow button which opens the sub menu.
      Returns:
      the button elements in the menu bar
    • getOverflowButton

      public TestBenchElement getOverflowButton()
      Gets the button which opens the sub menu of overflowing items, or null if the overflow button is not visible.
      Returns:
      the button which opens the sub menu of overflowing items
    • getSubMenuItems

      public List<TestBenchElement> getSubMenuItems()
      Get TestBenchElements representing sub menu items under the first sub menu.
      Returns:
      List of TestBenchElements representing sub menu items.
    • getSubMenuItems

      public List<TestBenchElement> getSubMenuItems(TestBenchElement overlay)
      Get TestBenchElements representing sub menu items under specific sub menu.
      Parameters:
      overlay - The sub menu overlay from which items are being collected.
      Returns:
      List of TestBenchElements representing sub menu items.
    • getSubMenu

      public TestBenchElement getSubMenu()
      Get the sub menu overlay element.
      Returns:
      TestBenchElement for the first open sub menu.
    • getAllSubMenus

      public List<TestBenchElement> getAllSubMenus()
      Get all the open sub menu overlay elements.
      Returns:
      List of TestBenchElements representing currently open sub menus.