Class MuiDatePickerFormField

  • All Implemented Interfaces:
    MuiComponent, com.github.grossopa.selenium.core.component.api.FormField, com.github.grossopa.selenium.core.component.WebComponent, org.openqa.selenium.interactions.Locatable, org.openqa.selenium.SearchContext, org.openqa.selenium.TakesScreenshot, org.openqa.selenium.WebElement, org.openqa.selenium.WrapsDriver, org.openqa.selenium.WrapsElement

    public class MuiDatePickerFormField
    extends MuiTextField
    The date picker text box with a popup on desktop.
    Since:
    1.8
    Author:
    Jack Yin
    See Also:
    https://mui.com/components/date-picker/#basic-usage
    • Field Summary

      • Fields inherited from class com.github.grossopa.selenium.core.component.DefaultWebComponent

        decorator, driver
      • Fields inherited from class com.github.grossopa.selenium.core.component.AbstractDelegatedWebElement

        element
    • Constructor Summary

      Constructors 
      Constructor Description
      MuiDatePickerFormField​(org.openqa.selenium.WebElement element, com.github.grossopa.selenium.core.ComponentWebDriver driver, MuiConfig config)
      Constructs an instance with the delegated element and root driver
      MuiDatePickerFormField​(org.openqa.selenium.WebElement element, com.github.grossopa.selenium.core.ComponentWebDriver driver, MuiConfig config, List<MuiCalendarPicker.ViewType> views)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void closePicker()
      Closes the displayed picker.
      void closePicker​(long delayInMillis)
      Closes the displayed picker with delay for animation.
      boolean equals​(Object o)  
      com.github.grossopa.selenium.core.component.WebComponent getDateButton()
      Gets the date selection icon button
      List<MuiCalendarPicker.ViewType> getViews()
      Gets the current specified views of the date picker.
      int hashCode()  
      MuiCalendarPicker openCalendarPicker()
      Expands the calendar picker
      MuiCalendarPicker openCalendarPicker​(long delayInMillis)
      Expands the calendar picker, with the delays for animation.
      void setDate​(java.time.LocalDate date)
      Sets the date by operating the component to expand the date picker and do the actions to select the date.
      void setDate​(java.time.LocalDate date, long delayInMillis)
      Sets the date by operating the component to expand the date picker and do the actions to select the date.
      String toString()  
      Set<MuiVersion> versions()
      Gets all the supported versions
      • Methods inherited from class com.github.grossopa.selenium.core.component.DefaultWebComponent

        as, attributeContains, driver, findComponent, findComponentAs, findComponents, findComponentsAs, findTextNodes, getId, isFocused, outerHTML, styleContains, to
      • Methods inherited from class com.github.grossopa.selenium.core.component.AbstractDelegatedWebElement

        clear, click, findElement, findElements, getAccessibleName, getAriaRole, getAttribute, getCoordinates, getCssValue, getDomAttribute, getDomProperty, getLocation, getRect, getScreenshotAs, getShadowRoot, getSize, getTagName, getText, getWrappedDriver, getWrappedElement, isDisplayed, isSelected, sendKeys, submit
      • Methods inherited from interface org.openqa.selenium.interactions.Locatable

        getCoordinates
      • Methods inherited from interface org.openqa.selenium.TakesScreenshot

        getScreenshotAs
      • Methods inherited from interface com.github.grossopa.selenium.core.component.WebComponent

        as, attributeContains, driver, findComponent, findComponentAs, findComponents, findComponentsAs, findElement, findElements, findTextNodes, getId, isFocused, outerHTML, styleContains, to, validate
      • Methods inherited from interface org.openqa.selenium.WebElement

        clear, click, getAccessibleName, getAriaRole, getAttribute, getCssValue, getDomAttribute, getDomProperty, getLocation, getRect, getShadowRoot, getSize, getTagName, getText, isDisplayed, isSelected, sendKeys, submit
      • Methods inherited from interface org.openqa.selenium.WrapsDriver

        getWrappedDriver
      • Methods inherited from interface org.openqa.selenium.WrapsElement

        getWrappedElement
    • Constructor Detail

      • MuiDatePickerFormField

        public MuiDatePickerFormField​(org.openqa.selenium.WebElement element,
                                      com.github.grossopa.selenium.core.ComponentWebDriver driver,
                                      MuiConfig config)
        Constructs an instance with the delegated element and root driver
        Parameters:
        element - the delegated element
        driver - the root driver
        config - the Material UI configuration
      • MuiDatePickerFormField

        public MuiDatePickerFormField​(org.openqa.selenium.WebElement element,
                                      com.github.grossopa.selenium.core.ComponentWebDriver driver,
                                      MuiConfig config,
                                      List<MuiCalendarPicker.ViewType> views)
    • Method Detail

      • getDateButton

        public com.github.grossopa.selenium.core.component.WebComponent getDateButton()
        Gets the date selection icon button
        Returns:
        the date selection icon button
      • openCalendarPicker

        public MuiCalendarPicker openCalendarPicker()
        Expands the calendar picker
        Returns:
        the popup calendar picker
      • openCalendarPicker

        public MuiCalendarPicker openCalendarPicker​(long delayInMillis)
        Expands the calendar picker, with the delays for animation.
        Parameters:
        delayInMillis - the delays in milliseconds
        Returns:
        the popup calendar picker
      • closePicker

        public void closePicker()
        Closes the displayed picker.
      • closePicker

        public void closePicker​(long delayInMillis)
        Closes the displayed picker with delay for animation.
        Parameters:
        delayInMillis - the delay in milliseconds
      • setDate

        public void setDate​(java.time.LocalDate date)
        Sets the date by operating the component to expand the date picker and do the actions to select the date. If the year does not include the corresponding value such as Year, so the year part of the date will be ignored.
        Parameters:
        date - the new date to set.
      • setDate

        public void setDate​(java.time.LocalDate date,
                            long delayInMillis)
        Sets the date by operating the component to expand the date picker and do the actions to select the date. If the year does not include the corresponding value such as Year, so the year part of the date will be ignored.
        Parameters:
        date - the new date to set.
        delayInMillis - to delay the actions following animations by milliseconds. recommended value is 500.
      • getViews

        public List<MuiCalendarPicker.ViewType> getViews()
        Gets the current specified views of the date picker.
        Returns:
        the current specified views of the date picker.