Package com.vaadin.testbench.elements
Class DateFieldElement
- 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.DateFieldElement
-
- 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
- Direct Known Subclasses:
PopupDateFieldElement
public class DateFieldElement extends AbstractDateFieldElement
Element class for testing DateField.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.vaadin.testbench.elements.AbstractComponentElement
AbstractComponentElement.ReadOnlyException
-
-
Constructor Summary
Constructors Constructor Description DateFieldElement()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clear DateField element.LocalDategetDate()Gets the value as a LocalDate object.org.openqa.selenium.WebElementgetInputElement()Gets the<input>element inside the component.protected DateTimeFormattergetISOFormatter()Gets a date and time formatter for ISO-8601 dates.StringgetValue()Return value of the date field element.voidopenPopup()Opens the date field popup.voidsetDate(LocalDate 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
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
-
clear
public void clear()
Clear DateField element.- Specified by:
clearin interfaceorg.openqa.selenium.WebElement- Overrides:
clearin classcom.vaadin.testbench.TestBenchElement
-
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.
-
setDate
public void setDate(LocalDate value)
Sets the value to the given date and time.- Parameters:
value- the date and time to set.
-
getDate
public LocalDate getDate()
Gets the value as a LocalDate 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 dates.- Returns:
- a date formatter for ISO-8601
- Since:
- 8.1.0
-
getInputElement
public org.openqa.selenium.WebElement getInputElement()
Gets the<input>element inside the component.- Returns:
- the input element inside the component
- Since:
- 8.1.1
-
-