Class TimePickerElement

  • All Implemented Interfaces:
    com.vaadin.testbench.commands.CanCompareScreenshots, com.vaadin.testbench.HasCallFunction, com.vaadin.testbench.HasDriver, com.vaadin.testbench.HasElementQuery, com.vaadin.testbench.HasHelper, com.vaadin.testbench.HasPropertySettersGetters, com.vaadin.testbench.HasSearchContext, com.vaadin.testbench.HasSelectByText, com.vaadin.testbench.HasStringValueProperty, com.vaadin.testbench.HasTestBenchCommandExecutor, org.openqa.selenium.SearchContext, org.openqa.selenium.TakesScreenshot, org.openqa.selenium.WebElement, org.openqa.selenium.WrapsElement

    public class TimePickerElement
    extends com.vaadin.testbench.TestBenchElement
    implements com.vaadin.testbench.HasStringValueProperty, com.vaadin.testbench.HasSelectByText, com.vaadin.testbench.HasHelper
    A TestBench element representing a <vaadin-time-picker> element.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void closeDropDown()
      Closes the drop down for the time picker.
      String getItemText​(int index)
      Gets the text content for the item inside the drop down with the given index.
      String getLastItemText()
      Gets the text content for the last item inside the drop down.
      String getSelectedText()  
      String getText()  
      TimePickerElement.TimePickerComboBoxElement getTimePickerComboBox()
      Gets the <vaadin-time-picker-combo-box> element inside the <vaadin-time-picker> element.
      com.vaadin.testbench.TestBenchElement getTimePickerInputElement()
      Gets the <input> element inside the <vaadin-time-picker> element.
      String getTimePickerInputValue()
      Gets the value property for the text field of the time picker.
      boolean isAutoOpen()
      Gets whether dropdown will open automatically or not.
      void openDropDown()
      Opens the drop down for the time picker.
      void scrollToItem​(int index)
      Scrolls to the item with the given index in the time picker drop down.
      void selectByText​(String timeInput)
      Simulates the user selecting a time via the input element.
      void selectItemByIndex​(int index)
      Selects the item with the given index by clicking on the item from the combo box drop down.
      void sendKeys​(CharSequence... keysToSend)  
      void waitUntilDropDownOpen()  
      • Methods inherited from class com.vaadin.testbench.TestBenchElement

        callFunction, clear, click, click, compareScreen, compareScreen, compareScreen, contextClick, dispatchEvent, dispatchEvent, doubleClick, equals, executeScript, findElement, findElements, focus, getAttribute, getCapabilities, getClassNames, getCommandExecutor, getContext, getCssValue, getDriver, getLocation, getProperty, getPropertyBoolean, getPropertyDouble, getPropertyElement, getPropertyElements, getPropertyInteger, getPropertyString, getRect, getScreenshotAs, getSize, getTagName, getWrappedElement, hasAttribute, hasClassName, hashCode, init, init, isChrome, isDisplayed, isEnabled, isFirefox, isSelected, scroll, scrollIntoView, scrollLeft, setProperty, setProperty, setProperty, setProperty, submit, waitForVaadin, waitUntil, waitUntil, wrap, wrapElement, wrapElements
      • Methods inherited from interface com.vaadin.testbench.HasElementQuery

        $, $
      • Methods inherited from interface com.vaadin.testbench.HasHelper

        getHelperComponent, getHelperText
      • Methods inherited from interface com.vaadin.testbench.HasPropertySettersGetters

        getProperty, getPropertyBoolean, getPropertyDouble, getPropertyElement, getPropertyElements, getPropertyInteger, getPropertyString, setProperty, setProperty, setProperty, setProperty
      • Methods inherited from interface com.vaadin.testbench.HasSearchContext

        getContext
      • Methods inherited from interface com.vaadin.testbench.HasStringValueProperty

        clear, getValue, setValue
      • Methods inherited from interface org.openqa.selenium.TakesScreenshot

        getScreenshotAs
      • Methods inherited from interface org.openqa.selenium.WebElement

        click, findElement, findElements, getAccessibleName, getAriaRole, getAttribute, getCssValue, getDomAttribute, getDomProperty, getLocation, getRect, getShadowRoot, getSize, getTagName, isDisplayed, isEnabled, isSelected, submit
    • Constructor Detail

      • TimePickerElement

        public TimePickerElement()
    • Method Detail

      • getTimePickerComboBox

        public TimePickerElement.TimePickerComboBoxElement getTimePickerComboBox()
        Gets the <vaadin-time-picker-combo-box> element inside the <vaadin-time-picker> element.
        Returns:
        the combo box light element
      • getTimePickerInputElement

        public com.vaadin.testbench.TestBenchElement getTimePickerInputElement()
        Gets the <input> element inside the <vaadin-time-picker> element.
        Returns:
        the combo box light element
      • getText

        public String getText()
        Specified by:
        getText in interface org.openqa.selenium.WebElement
        Overrides:
        getText in class com.vaadin.testbench.TestBenchElement
      • getItemText

        public String getItemText​(int index)
        Gets the text content for the item inside the drop down with the given index.

        NOTE: the time picker drop down should be opened with openDropDown() first.

        Parameters:
        index - the index of the item
        Returns:
        the text content for the item
      • getLastItemText

        public String getLastItemText()
        Gets the text content for the last item inside the drop down.

        NOTE: the time picker drop down should be opened with openDropDown() first.

        Returns:
        the text content for the last item
      • getTimePickerInputValue

        public String getTimePickerInputValue()
        Gets the value property for the text field of the time picker.

        NOTE: this is not the same as the value property for the time picker, returned by HasStringValueProperty.getValue().

        Returns:
        the value of the text field inside the time picker
      • openDropDown

        public void openDropDown()
        Opens the drop down for the time picker.
      • waitUntilDropDownOpen

        public void waitUntilDropDownOpen()
      • closeDropDown

        public void closeDropDown()
        Closes the drop down for the time picker.
      • scrollToItem

        public void scrollToItem​(int index)
        Scrolls to the item with the given index in the time picker drop down.

        NOTE: the drop down must be opened before scrolling, e.g. use openDropDown().

        Parameters:
        index - the index of the item to scroll to
      • selectItemByIndex

        public void selectItemByIndex​(int index)
        Selects the item with the given index by clicking on the item from the combo box drop down.
        Parameters:
        index - the index of the item to select
      • selectByText

        public void selectByText​(String timeInput)
        Simulates the user selecting a time via the input element. This effectively clears the input element with a key shortcut, then types the given time string and finally presses Enter to commit the new time.
        Specified by:
        selectByText in interface com.vaadin.testbench.HasSelectByText
        Parameters:
        timeInput - the time string to enter, not null
      • getSelectedText

        public String getSelectedText()
        Specified by:
        getSelectedText in interface com.vaadin.testbench.HasSelectByText
      • isAutoOpen

        public boolean isAutoOpen()
        Gets whether dropdown will open automatically or not.
        Returns:
        true if enabled, false otherwise
      • sendKeys

        public void sendKeys​(CharSequence... keysToSend)
        Specified by:
        sendKeys in interface org.openqa.selenium.WebElement
        Overrides:
        sendKeys in class com.vaadin.testbench.TestBenchElement