Package com.vaadin.testbench.elements
Class DateTimeFieldElement
- java.lang.Object
-
- com.vaadin.testbench.AbstractHasTestBenchCommandExecutor
-
- com.vaadin.testbench.TestBenchElement
-
- com.vaadin.testbench.elementsbase.AbstractElement
-
- com.vaadin.testbench.elements.AbstractComponentElement
-
- com.vaadin.testbench.elements.AbstractFieldElement
-
- com.vaadin.testbench.elements.AbstractDateFieldElement
-
- com.vaadin.testbench.elements.DateTimeFieldElement
-
- 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 DateTimeFieldElement extends AbstractDateFieldElement
Element class for testing DateTimeField.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.vaadin.testbench.elements.AbstractComponentElement
AbstractComponentElement.ReadOnlyException
-
-
Constructor Summary
Constructors Constructor Description DateTimeFieldElement()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LocalDateTimegetDateTime()Gets the value as a LocalDateTime object.protected DateTimeFormattergetISOFormatter()Gets a date and time formatter for ISO-8601.StringgetValue()Return value of the date field element.voidopenPopup()Opens the date field popup.voidsetDateTime(LocalDateTime value)Sets the value to the given date and time.voidsetValue(CharSequence chars)Set value of the date field element.-
Methods inherited from class com.vaadin.testbench.elements.AbstractDateFieldElement
getISOValue, setISOValue
-
Methods inherited from class com.vaadin.testbench.elements.AbstractFieldElement
clearElementClientSide, clientSelectElement
-
Methods inherited from class com.vaadin.testbench.elements.AbstractComponentElement
getCaption, getHTML, getStyleAttribute, isReadOnly
-
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
-
-
-
-
Method Detail
-
getValue
public String getValue()
Return value of the date field element.- Returns:
- value of the date field element
-
setValue
public void setValue(CharSequence chars) throws AbstractComponentElement.ReadOnlyException
Set value of the date field element.- Parameters:
chars- new value of the date field- Throws:
AbstractComponentElement.ReadOnlyException- if the date field is in readonly mode
-
openPopup
public void openPopup()
Opens the date field popup.
-
setDateTime
public void setDateTime(LocalDateTime value)
Sets the value to the given date and time.- Parameters:
value- the date and time to set.
-
getDateTime
public LocalDateTime getDateTime()
Gets the value as a LocalDateTime object.- Returns:
- the current value as a date object, or null if a date is not set or if the text field contains an invalid date
-
getISOFormatter
protected DateTimeFormatter getISOFormatter()
Gets a date and time formatter for ISO-8601.- Returns:
- a date and time formatter for ISO-8601
- Since:
- 8.1.0
-
-