Class TimePickerElement
java.lang.Object
com.vaadin.testbench.TestBenchElement
com.vaadin.flow.component.timepicker.testbench.TimePickerElement
- All Implemented Interfaces:
CanCompareScreenshots,HasCallFunction,HasClearButton,HasDriver,HasElementQuery,HasHelper,HasPropertySettersGetters,HasSearchContext,HasSelectByText,HasStringValueProperty,HasTestBenchCommandExecutor,HasValidation,org.openqa.selenium.SearchContext,org.openqa.selenium.TakesScreenshot,org.openqa.selenium.WebElement,org.openqa.selenium.WrapsElement
public class TimePickerElement
extends TestBenchElement
implements HasStringValueProperty, HasSelectByText, HasHelper, HasClearButton, HasValidation
A TestBench element representing a
<vaadin-time-picker>
element.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA TestBench element representing<vaadin-time-picker-combo-box>element inside the<vaadin-time-picker>element.static classA 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 -
Method Summary
Modifier and TypeMethodDescriptionvoidCloses the drop down for the time picker.getItemText(int index) Gets the text content for the item inside the drop down with the given index.Gets the text content for the last item inside the drop down.Gets the text of the currently selected option.getText()Gets the<vaadin-time-picker-combo-box>element inside the<vaadin-time-picker>element.Gets the<input>element inside the<vaadin-time-picker>element.Gets the value property for the text field of the time picker.booleanGets whether dropdown will open automatically or not.voidOpens 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) voidMethods 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, getDomAttribute, getDomProperty, 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, wrapElementsMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.testbench.HasCallFunction
callFunctionMethods inherited from interface com.vaadin.testbench.HasClearButton
clickClearButton, isClearButtonVisibleMethods inherited from interface com.vaadin.testbench.HasElementQuery
$, $Methods inherited from interface com.vaadin.testbench.HasHelper
getHelperComponent, getHelperTextMethods inherited from interface com.vaadin.testbench.HasPropertySettersGetters
getProperty, getPropertyBoolean, getPropertyDouble, getPropertyElement, getPropertyElements, getPropertyInteger, getPropertyString, setProperty, setProperty, setProperty, setPropertyMethods inherited from interface com.vaadin.testbench.HasSearchContext
getContextMethods inherited from interface com.vaadin.testbench.HasStringValueProperty
clear, getValue, setValueMethods inherited from interface com.vaadin.testbench.HasValidation
getErrorMessage, isInvalid, isRequiredMethods inherited from interface org.openqa.selenium.TakesScreenshot
getScreenshotAsMethods 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 Details
-
TimePickerElement
public TimePickerElement()
-
-
Method Details
-
getTimePickerComboBox
Gets the<vaadin-time-picker-combo-box>element inside the<vaadin-time-picker>element.- Returns:
- the combo box light element
-
getTimePickerInputElement
Gets the<input>element inside the<vaadin-time-picker>element.- Returns:
- the combo box light element
-
getText
- Specified by:
getTextin interfaceorg.openqa.selenium.WebElement- Overrides:
getTextin classTestBenchElement
-
getItemText
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
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
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
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 interfaceHasSelectByText- Parameters:
timeInput- the time string to enter, notnull
-
getSelectedText
Description copied from interface:HasSelectByTextGets the text of the currently selected option.- Specified by:
getSelectedTextin interfaceHasSelectByText- Returns:
- the text of the current option
-
isAutoOpen
public boolean isAutoOpen()Gets whether dropdown will open automatically or not.- Returns:
trueif enabled,falseotherwise
-
sendKeys
- Specified by:
sendKeysin interfaceorg.openqa.selenium.WebElement- Overrides:
sendKeysin classTestBenchElement
-