Skip to main content

Overview

The IntegerFieldElement class is a Playwright wrapper for the <vaadin-integer-field> component. It provides methods to interact with integer input fields, including min/max/step constraints and step controls.

Component Tag

<vaadin-integer-field>

Extends

  • AbstractNumberFieldElement

Inherited Interfaces

  • HasValidationPropertiesElement - Validation state and error messages
  • HasInputFieldElement - Value, label, helper text, and styling
  • HasPrefixElement - Prefix slot content
  • HasSuffixElement - Suffix slot content
  • HasClearButtonElement - Clear button functionality
  • HasPlaceholderElement - Placeholder text
  • HasAllowedCharPatternElement - Character input restrictions
  • HasThemeElement - Theme variants
  • FocusableElement - Focus and blur operations
  • HasAriaLabelElement - ARIA label support
  • HasEnabledElement - Enabled/disabled state
  • HasTooltipElement - Tooltip text

Constructor

Locator
required
The Playwright locator for the <vaadin-integer-field> element

Factory Methods

getByLabel (Page)

Get an integer field by its accessible label. Uses ARIA role spinbutton.
Page
required
The Playwright page
String
required
The accessible label of the integer field

Example

getByLabel (Locator)

Get an integer field by its accessible label within a scope.
Locator
required
The locator to search within
String
required
The accessible label of the integer field

Methods

getStep

Get the current step value.
Returns: The step as an Integer, or null if not set

setStep

Set the step value.
int
required
The step to apply

assertStep

Assert the step attribute matches the expected value.
Integer
The expected step, or null to assert no explicit step is set

getMin

Get the current minimum value.
Returns: The minimum as an Integer, or null if not set

setMin

Set the minimum value.
int
required
The minimum to apply

assertMin

Assert the min attribute matches the expected value.
Integer
The expected minimum, or null to assert no explicit minimum is set

getMax

Get the current maximum value.
Returns: The maximum as an Integer, or null if not set

setMax

Set the maximum value.
int
required
The maximum to apply

assertMax

Assert the max attribute matches the expected value.
Integer
The expected maximum, or null to assert no explicit maximum is set

Inherited Methods

From AbstractNumberFieldElement:
  • getHasControls() - Check if step controls are visible
  • assertHasControls(boolean hasControls) - Assert step controls visibility
  • clickIncreaseButton() - Click the increase button
  • clickDecreaseButton() - Click the decrease button
From HasValueElement:
  • getValue() - Get current value
  • setValue(String value) - Set field value
  • clear() - Clear the value
  • assertValue(String value) - Assert value matches
From HasValidationPropertiesElement:
  • assertValid() - Assert field is valid
  • assertInvalid() - Assert field is invalid
  • assertErrorMessage(String message) - Assert error message text
  • getErrorMessageLocator() - Get error message locator
From FocusableElement:
  • focus() - Focus the field
  • blur() - Blur the field
  • getTabIndex() - Get tab index
  • assertIsFocused() - Assert field has focus
  • assertIsNotFocused() - Assert field does not have focus

Complete Example