Class MenuBarElement

  • All Implemented Interfaces:
    com.vaadin.testbench.commands.CanCompareScreenshots, com.vaadin.testbench.commands.CanWaitForVaadin, com.vaadin.testbench.commands.TestBenchElementCommands, com.vaadin.testbench.HasDriver, com.vaadin.testbench.HasSearchContext, com.vaadin.testbench.HasTestBenchCommandExecutor, org.openqa.selenium.SearchContext, org.openqa.selenium.TakesScreenshot, org.openqa.selenium.WebElement, org.openqa.selenium.WrapsElement

    public class MenuBarElement
    extends AbstractComponentElement
    • Constructor Summary

      Constructors 
      Constructor Description
      MenuBarElement()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clickItem​(String... path)
      Clicks the item specified by a full path given as variable arguments.
      Fails if path given is not full (ie: last submenu is already opened, and path given is last item only).
      • Methods inherited from class com.vaadin.testbench.TestBenchElement

        clear, click, click, clickHiddenElement, compareScreen, compareScreen, compareScreen, contextClick, doubleClick, equals, findElement, findElements, focus, getAccessibleName, getAriaRole, getAttribute, getCapabilities, getClassNames, getCommandExecutor, getContext, getCssValue, getDomAttribute, getDriver, getId, getLocation, getRect, getScreenshotAs, getShadowRoot, getSize, getTagName, getText, getWrappedElement, hasAttribute, hasClassName, hashCode, init, init, isChrome, isDisplayed, isEnabled, isFirefox, isFocused, isSelected, scroll, scrollIntoView, scrollLeft, sendKeys, showTooltip, submit, waitForVaadin, waitUntil, waitUntil, wrap, wrapElement, wrapElements
      • Methods inherited from class com.vaadin.testbench.AbstractHasTestBenchCommandExecutor

        $, $$, isElementPresent, isElementPresent
      • Methods inherited from interface org.openqa.selenium.WebElement

        getDomProperty
    • Constructor Detail

      • MenuBarElement

        public MenuBarElement()
    • Method Detail

      • clickItem

        public void clickItem​(String... path)
        Clicks the item specified by a full path given as variable arguments.
        Fails if path given is not full (ie: last submenu is already opened, and path given is last item only).

        Example:

         // clicks on "File" item
         menuBarElement.click("File");
         // clicks on "Copy" item in "File" top level menu.
         menuBarElement.click("File", "Copy");
         
        Parameters:
        path - Array of items to click through