Class 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.
    • Constructor Detail

      • DateFieldElement

        public DateFieldElement()
    • Method Detail

      • clear

        public void clear()
        Clear DateField element.
        Specified by:
        clear in interface org.openqa.selenium.WebElement
        Overrides:
        clear in class com.vaadin.testbench.TestBenchElement
      • getValue

        public String getValue()
        Return value of the date field element.
        Returns:
        value of the date field element
      • 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