Overview
VaadinElement is the abstract base class for all Vaadin component wrappers in Drama Finder. It exposes common helpers for clicking, visibility assertions, text retrieval, and generic DOM property access. Concrete component classes extend this base and add component-specific APIs.
Constructor
VaadinElement(Locator locator)
Creates a new VaadinElement wrapper.Locator
required
The Playwright locator pointing to the component root element
Methods
click()
Clicks the component root element.void
This method does not return a value
getText()
Gets the textual content of the component root element.String
The text content, or
null if nonegetLocator()
Gets the underlying Playwright locator for the component.Locator
The Playwright locator for this element
setProperty(String name, Object value)
Sets a DOM property on the underlying element (e.g.,value, disabled).
String
required
The property name to set
Object
required
The property value to assign
void
This method does not return a value
getProperty(String name)
Gets a DOM property from the underlying element.String
required
The property name to retrieve
Object
The property value, or
null if the property is absentisVisible()
Checks whether the component is visible.boolean
true when the element is visible, false otherwiseassertVisible()
Asserts that the component is visible. This assertion auto-retries until the timeout is reached.void
Throws an assertion error if the element is not visible
isHidden()
Checks whether the component is hidden.boolean
true when the element is hidden, false otherwiseassertHidden()
Asserts that the component is hidden. This assertion auto-retries until the timeout is reached.void
Throws an assertion error if the element is visible
Usage Examples
Basic Interaction
Property Manipulation
Visibility Checks
Text Content Retrieval
Notes
- All assertion methods use Playwright’s auto-retry mechanism and will wait until the condition is met or the timeout is reached.
- The
getProperty()andsetProperty()methods operate on DOM properties, not HTML attributes. UsegetLocator().getAttribute()for HTML attributes. - Concrete component classes like
ButtonElement,TextFieldElement, etc., extend this base class and inherit all these methods. - The
isVisible()andisHidden()methods are inverses of each other:isHidden()returns!isVisible().