Class TimePickerElement
- java.lang.Object
-
- com.vaadin.testbench.TestBenchElement
-
- com.vaadin.flow.component.timepicker.testbench.TimePickerElement
-
- All Implemented Interfaces:
com.vaadin.testbench.commands.CanCompareScreenshots,com.vaadin.testbench.HasCallFunction,com.vaadin.testbench.HasClearButton,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,com.vaadin.testbench.HasValidation,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, com.vaadin.testbench.HasValidation, com.vaadin.testbench.HasClearButtonA TestBench element representing a<vaadin-time-picker>element.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTimePickerElement.TimePickerComboBoxElementA TestBench element representing<vaadin-time-picker-combo-box>element inside the<vaadin-time-picker>element.static classTimePickerElement.TimePickerOverlayElementA TestBench element representing<vaadin-time-picker-overlay>element that contains the items for the<vaadin-time-picker>element when the drop down has been opened withopenDropDown().
-
Constructor Summary
Constructors Constructor Description TimePickerElement()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcloseDropDown()Closes the drop down for the time picker.StringgetItemText(int index)Gets the text content for the item inside the drop down with the given index.StringgetLastItemText()Gets the text content for the last item inside the drop down.StringgetSelectedText()StringgetText()TimePickerElement.TimePickerComboBoxElementgetTimePickerComboBox()Gets the<vaadin-time-picker-combo-box>element inside the<vaadin-time-picker>element.com.vaadin.testbench.TestBenchElementgetTimePickerInputElement()Gets the<input>element inside the<vaadin-time-picker>element.StringgetTimePickerInputValue()Gets the value property for the text field of the time picker.booleanisAutoOpen()Gets whether dropdown will open automatically or not.voidopenDropDown()Opens the drop down for the time picker.voidscrollToItem(int index)Scrolls to the item with the given index in the time picker drop down.voidselectByText(String timeInput)Simulates the user selecting a time via the input element.voidselectItemByIndex(int index)Selects the item with the given index by clicking on the item from the combo box drop down.voidsendKeys(CharSequence... keysToSend)voidwaitUntilDropDownOpen()-
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, getChildren, getClassNames, getCommandExecutor, getContext, getCssValue, getDriver, getId, getLocation, getParent, getProperty, getPropertyBoolean, getPropertyDouble, getPropertyElement, getPropertyElements, getPropertyInteger, getPropertyString, getRect, getScreenshotAs, getShadowRoot, getSize, getTagName, getWrappedElement, hasAttribute, hasClassName, hashCode, hover, init, init, isChrome, isDisplayed, isEnabled, isFirefox, isFocused, isReadOnly, isSelected, scroll, scrollIntoView, scrollLeft, setProperty, setProperty, setProperty, setProperty, submit, waitForVaadin, waitUntil, waitUntil, wrap, wrapElement, wrapElements
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.vaadin.testbench.HasClearButton
clickClearButton, isClearButtonVisible
-
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.HasStringValueProperty
clear, getValue, setValue
-
-
-
-
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:
getTextin interfaceorg.openqa.selenium.WebElement- Overrides:
getTextin classcom.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 pressesEnterto commit the new time.- Specified by:
selectByTextin interfacecom.vaadin.testbench.HasSelectByText- Parameters:
timeInput- the time string to enter, notnull
-
getSelectedText
public String getSelectedText()
- Specified by:
getSelectedTextin interfacecom.vaadin.testbench.HasSelectByText
-
isAutoOpen
public boolean isAutoOpen()
Gets whether dropdown will open automatically or not.- Returns:
trueif enabled,falseotherwise
-
sendKeys
public void sendKeys(CharSequence... keysToSend)
- Specified by:
sendKeysin interfaceorg.openqa.selenium.WebElement- Overrides:
sendKeysin classcom.vaadin.testbench.TestBenchElement
-
-