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.The Playwright locator pointing to the component root element
Methods
click()
Clicks the component root element.This method does not return a value
getText()
Gets the textual content of the component root element.The text content, or
null if nonegetLocator()
Gets the underlying Playwright locator for the component.The Playwright locator for this element
setProperty(String name, Object value)
Sets a DOM property on the underlying element (e.g.,value, disabled).
The property name to set
The property value to assign
This method does not return a value
getProperty(String name)
Gets a DOM property from the underlying element.The property name to retrieve
The property value, or
null if the property is absentisVisible()
Checks whether the component is visible.true when the element is visible, false otherwiseassertVisible()
Asserts that the component is visible. This assertion auto-retries until the timeout is reached.Throws an assertion error if the element is not visible
isHidden()
Checks whether the component is hidden.true when the element is hidden, false otherwiseassertHidden()
Asserts that the component is hidden. This assertion auto-retries until the timeout is reached.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().