Skip to main content

Overview

HasSuffixElement provides utilities to interact with Vaadin components that implement the HasSuffix interface, which allows placing content in a suffix slot. The suffix typically appears at the end of the component, after the main input or content area. This mixin interface extends HasLocatorElement and provides default implementations for accessing, reading, and asserting suffix slot content.

Interface

Methods

getSuffixLocator()

Returns a locator for the suffix slot content.
Returns: Locator targeting the first element with slot="suffix" Implementation:

getSuffixText()

Retrieves the text content of the suffix slot.
Returns: The text content of the suffix element

assertSuffixHasText()

Asserts that the suffix slot has the expected text, or is hidden when null.
String
Expected text content of the suffix. If null, asserts that the suffix is not visible.
Behavior:
  • If text is non-null: Asserts the suffix has exactly that text
  • If text is null: Asserts the suffix is not visible

Implementing Classes

The following element classes implement HasSuffixElement:
  • TextFieldElement - Text input fields
  • BigDecimalFieldElement - Decimal number fields
  • AbstractNumberFieldElement - Base class for number fields
  • ButtonElement - Action buttons
  • SideNavigationItemElement - Navigation items

Usage Examples

Basic Suffix Access

Custom Suffix Interactions

Asserting Suffix Visibility

Integration Test Example

Button with Suffix Example

Vaadin Documentation

For more information about the Vaadin HasSuffix interface, see the Vaadin Components documentation.