Skip to main content

TimePickerElement

Playwright element wrapper for <vaadin-time-picker>. Adds convenience methods for LocalTime values and lookup by label.

Component Tag

vaadin-time-picker

Implements

  • HasInputFieldElement
  • HasValidationPropertiesElement
  • HasClearButtonElement
  • HasPlaceholderElement
  • HasThemeElement
  • FocusableElement
  • HasAriaLabelElement
  • HasEnabledElement
  • HasTooltipElement
  • HasLabelElement
  • HasHelperElement

Factory Methods

getByLabel (Page)

Get the TimePickerElement by its label. Uses ARIA role COMBOBOX.
Page
required
The Playwright page
String
required
The accessible label of the field
Returns: The matching TimePickerElement

getByLabel (Locator)

Get the TimePickerElement by its label within a given scope.
Locator
required
The locator to search within
String
required
The accessible label of the field
Returns: The matching TimePickerElement

Constructor

TimePickerElement

Create a new TimePickerElement.
Locator
required
The locator for the <vaadin-time-picker> element

Methods

setValue (LocalTime)

Set the value using a LocalTime formatted as HH:mm.
LocalTime
required
The time to set

getValueAsLocalTime

Get the current value as a LocalTime. Returns: The parsed time or null when empty

assertValue (LocalTime)

Assert that the value equals the provided time.
LocalTime
Expected LocalTime or null for empty

getAriaLabelLocator

Get the locator for ARIA label. Returns: The input locator

getFocusLocator

Get the locator to use for focus operations. Returns: The input locator

getEnabledLocator

Get the locator to use for enabled/disabled checks. Returns: The input locator

Usage Examples

Basic Time Selection

Min/Max/Step Validation

Theme

Focus

ARIA Label

Enabled/Disabled

Tooltip