Class MuiDatePickerFormField
- java.lang.Object
-
- com.github.grossopa.selenium.core.component.AbstractDelegatedWebElement
-
- com.github.grossopa.selenium.core.component.DefaultWebComponent
-
- com.github.grossopa.selenium.component.mui.v4.AbstractMuiComponent
-
- com.github.grossopa.selenium.component.mui.v4.inputs.MuiTextField
-
- com.github.grossopa.selenium.component.mui.v5.datetime.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.component.mui.v4.inputs.MuiTextField
COMPONENT_NAME
-
Fields inherited from class com.github.grossopa.selenium.component.mui.v4.AbstractMuiComponent
config
-
-
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 driverMuiDatePickerFormField(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 voidclosePicker()Closes the displayed picker.voidclosePicker(long delayInMillis)Closes the displayed picker with delay for animation.booleanequals(Object o)com.github.grossopa.selenium.core.component.WebComponentgetDateButton()Gets the date selection icon buttonList<MuiCalendarPicker.ViewType>getViews()Gets the current specified views of the date picker.inthashCode()MuiCalendarPickeropenCalendarPicker()Expands the calendar pickerMuiCalendarPickeropenCalendarPicker(long delayInMillis)Expands the calendar picker, with the delays for animation.voidsetDate(java.time.LocalDate date)Sets the date by operating the component to expand the date picker and do the actions to select the date.voidsetDate(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.StringtoString()Set<MuiVersion>versions()Gets all the supported versions-
Methods inherited from class com.github.grossopa.selenium.component.mui.v4.inputs.MuiTextField
getComponentName, getInput, getLabel, isEnabled, sendText
-
Methods inherited from class com.github.grossopa.selenium.component.mui.v4.AbstractMuiComponent
config, validate
-
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 class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
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
-
-
-
-
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 elementdriver- the root driverconfig- 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
-
versions
public Set<MuiVersion> versions()
Description copied from interface:MuiComponentGets all the supported versions- Specified by:
versionsin interfaceMuiComponent- Overrides:
versionsin classMuiTextField- Returns:
- all the supported versions
-
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.
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classAbstractMuiComponent
-
hashCode
public int hashCode()
- Overrides:
hashCodein classAbstractMuiComponent
-
toString
public String toString()
- Overrides:
toStringin classAbstractMuiComponent
-
-