Class DateTimePickerElement

java.lang.Object
com.vaadin.testbench.TestBenchElement
com.vaadin.flow.component.datetimepicker.testbench.DateTimePickerElement
All Implemented Interfaces:
CanCompareScreenshots, HasCallFunction, HasDriver, HasElementQuery, HasHelper, HasLabel, HasPropertySettersGetters, HasSearchContext, HasTestBenchCommandExecutor, org.openqa.selenium.SearchContext, org.openqa.selenium.TakesScreenshot, org.openqa.selenium.WebElement, org.openqa.selenium.WrapsElement

public class DateTimePickerElement extends TestBenchElement implements HasLabel, HasHelper
A TestBench element representing a <vaadin-date-time-picker> element.
  • Constructor Details

    • DateTimePickerElement

      public DateTimePickerElement()
  • Method Details

    • clear

      public void clear()
      Clears the value of the date time picker.
      Specified by:
      clear in interface org.openqa.selenium.WebElement
      Overrides:
      clear in class TestBenchElement
    • setDateTime

      public void setDateTime(LocalDateTime dateTime)
      Selects the given date time.
      Parameters:
      dateTime - the date time to set
    • getDateTime

      public LocalDateTime getDateTime()
      Gets the selected date time
      Returns:
      the selected date time or null if no date time is selected
    • setDate

      public void setDate(LocalDate date)
      Selects the given date.
      Parameters:
      date - the date to set
    • getDate

      public LocalDate getDate()
      Gets the selected date
      Returns:
      the selected date or null if no date is selected
    • setTime

      public void setTime(LocalTime time)
      Selects the given time.
      Parameters:
      time - the time to set
    • getTime

      public LocalTime getTime()
      Gets the selected time
      Returns:
      the selected time or null if no time is selected
    • getDatePresentation

      public String getDatePresentation()
      Gets the visible presentation value from the inner DatePicker as a string. This value depends on the used Locale.
      Returns:
      the presentation value of the inner date picker
    • getTimePresentation

      public String getTimePresentation()
      Gets the visible presentation value from the inner TimePicker as a string. This value depends on the used Locale.
      Returns:
      the presentation value of the inner time picker
    • isAutoOpen

      public boolean isAutoOpen()
      When auto open is enabled, the dropdown will open when the field is clicked.
      Returns:
      true if auto open is enabled. false otherwise. Default is true
    • getHelperComponent

      public TestBenchElement getHelperComponent()
      Gets the slotted helper component for the element.
      Specified by:
      getHelperComponent in interface HasHelper
      Returns:
      the slotted component or null if there is no component