Class DatePicker
- java.lang.Object
-
- org.primefaces.selenium.AbstractPrimePageFragment
-
- org.primefaces.selenium.component.base.AbstractComponent
-
- org.primefaces.selenium.component.base.AbstractInputComponent
-
- org.primefaces.selenium.component.DatePicker
-
- All Implemented Interfaces:
org.openqa.selenium.SearchContext,org.openqa.selenium.TakesScreenshot,org.openqa.selenium.WebElement,org.openqa.selenium.WrapsElement
public abstract class DatePicker extends AbstractInputComponent
Component wrapper for the PrimeFacesp:datePicker.
-
-
Constructor Summary
Constructors Constructor Description DatePicker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclick()org.openqa.selenium.WebElementgetClearButton()Gets the Clear button on the overlay panel.org.openqa.selenium.WebElementgetInput()The input element reference.org.openqa.selenium.WebElementgetNextMonthLink()Gets the Next Month link in the navigator.org.openqa.selenium.WebElementgetPanel()org.openqa.selenium.WebElementgetPreviousMonthLink()Gets the Previous Month link in the navigator.longgetTimezoneOffset()Gets the browser time zone offset.org.openqa.selenium.WebElementgetTodayButton()Gets the Today button on the overlay panel.LocalDateTimegetValue()LocalDategetValueAsLocalDate()StringgetWidgetDate()Gets the JS date value from the widget.voidhidePanel()Hides the overlay panel.booleanisCloseAjaxified()Is this component AJAX enabled with "close"?booleanisDateSelectAjaxified()Is this component AJAX enabled with "dateSelect"?booleanisLazy()Is this a lazy datepicker.booleanisViewChangeAjaxified()Is this component AJAX enabled with "viewChange"?StringmillisAsFormattedDate(long millis)org.openqa.selenium.WebElementselectDay(String day)Selects a day in the overlay panel.voidselectMonthDropdown(int month)Select a month from the drodown.voidselectYearDropdown(int year)Select a year from the drodown.voidsetDate(long epoch)Widget API call to set date to this epoch in millis.voidsetDate(LocalDateTime dateTime)Widget API call to set date to this LocalDateTime.voidsetValue(long millis)voidsetValue(LocalDate localDate)voidsetValue(LocalDateTime dateTime)org.openqa.selenium.WebElementshowPanel()Shows the overlay panel.voidtoggleMonthDropdown()Open the month select dropdown.voidtoggleYearDropdown()Open the year select dropdown.voidupdateViewDate(long epoch)Widget API call to update the overlay popup to this epoch in millis.-
Methods inherited from class org.primefaces.selenium.component.base.AbstractInputComponent
clear, copyToClipboard, disable, enable, getAssignedLabel, getAssignedLabelText, isEnabled, isOnchangeAjaxified, pasteFromClipboard, selectAllText
-
Methods inherited from class org.primefaces.selenium.component.base.AbstractComponent
destroy, getWidgetByIdScript, getWidgetConfiguration, getWidgetConfigurationAsString, isAjaxified, isAjaxified
-
Methods inherited from class org.primefaces.selenium.AbstractPrimePageFragment
getElementLocator, getId, getRoot, getWebDriver, getWrappedElement, setElementLocator, setWebDriver
-
-
-
-
Method Detail
-
click
public void click()
-
getInput
public org.openqa.selenium.WebElement getInput()
Description copied from class:AbstractInputComponentThe input element reference.- Overrides:
getInputin classAbstractInputComponent- Returns:
- the
WebElementrepresenting the input.
-
getPanel
public org.openqa.selenium.WebElement getPanel()
-
isDateSelectAjaxified
public boolean isDateSelectAjaxified()
Is this component AJAX enabled with "dateSelect"?- Returns:
- true if AJAX enabled false if not
-
isViewChangeAjaxified
public boolean isViewChangeAjaxified()
Is this component AJAX enabled with "viewChange"?- Returns:
- true if AJAX enabled false if not
-
isCloseAjaxified
public boolean isCloseAjaxified()
Is this component AJAX enabled with "close"?- Returns:
- true if AJAX enabled false if not
-
getNextMonthLink
public org.openqa.selenium.WebElement getNextMonthLink()
Gets the Next Month link in the navigator.- Returns:
- the Next Month link
-
getPreviousMonthLink
public org.openqa.selenium.WebElement getPreviousMonthLink()
Gets the Previous Month link in the navigator.- Returns:
- the Previous Month link
-
selectDay
public org.openqa.selenium.WebElement selectDay(String day)
Selects a day in the overlay panel.- Parameters:
day- the day to select- Returns:
- the day selected
-
getClearButton
public org.openqa.selenium.WebElement getClearButton()
Gets the Clear button on the overlay panel.- Returns:
- the Clear button
-
getTodayButton
public org.openqa.selenium.WebElement getTodayButton()
Gets the Today button on the overlay panel.- Returns:
- the Today button
-
getValue
public LocalDateTime getValue()
-
getValueAsLocalDate
public LocalDate getValueAsLocalDate()
-
setValue
public void setValue(LocalDate localDate)
-
setValue
public void setValue(LocalDateTime dateTime)
-
setValue
public void setValue(long millis)
-
millisAsFormattedDate
public String millisAsFormattedDate(long millis)
-
setDate
public void setDate(LocalDateTime dateTime)
Widget API call to set date to this LocalDateTime.- Parameters:
dateTime- the LocalDateTime to set to
-
setDate
public void setDate(long epoch)
Widget API call to set date to this epoch in millis.- Parameters:
epoch- epoch in milliseconds
-
getWidgetDate
public String getWidgetDate()
Gets the JS date value from the widget.- Returns:
- the JS date value or null
-
isLazy
public boolean isLazy()
Is this a lazy datepicker.- Returns:
- true if lazy
-
updateViewDate
public void updateViewDate(long epoch)
Widget API call to update the overlay popup to this epoch in millis.- Parameters:
epoch- epoch in milliseconds
-
showPanel
public org.openqa.selenium.WebElement showPanel()
Shows the overlay panel.- Returns:
- the panel shown
-
hidePanel
public void hidePanel()
Hides the overlay panel.
-
getTimezoneOffset
public long getTimezoneOffset()
Gets the browser time zone offset.- Returns:
- the browser time zone offset in milliseconds
-
toggleMonthDropdown
public void toggleMonthDropdown()
Open the month select dropdown.
-
selectMonthDropdown
public void selectMonthDropdown(int month)
Select a month from the drodown.- Parameters:
month- the month to select
-
toggleYearDropdown
public void toggleYearDropdown()
Open the year select dropdown.
-
selectYearDropdown
public void selectYearDropdown(int year)
Select a year from the drodown.- Parameters:
year- the year to select
-
-