Skip to main content

Overview

HasLocatorElement is the foundational interface for all Drama Finder element wrappers. It provides access to the underlying Playwright Locator that represents the component’s root element in the DOM. This interface serves as the base contract that all other mixin interfaces extend, enabling composition of element behaviors through Java’s interface default methods.

Interface

Methods

getLocator()

Returns the root Playwright locator for the component.
Returns: The root Locator representing this component’s DOM element

Implementing Classes

All Drama Finder element classes implement this interface, either directly or through inheritance:
  • VaadinElement (base class for all elements)
  • TextFieldElement
  • ButtonElement
  • ComboBoxElement
  • SelectElement
  • MultiSelectComboBoxElement
  • BigDecimalFieldElement
  • AbstractNumberFieldElement
  • SideNavigationItemElement
  • All other element wrappers in the library

Usage Example

Design Pattern

HasLocatorElement enables the Mixin Interface Pattern used throughout Drama Finder. By requiring only a locator, other interfaces can add default method implementations that build on top of it:
This approach provides:
  • Composition over inheritance: Elements can mix and match capabilities
  • Code reuse: Shared behavior is implemented once in the interface
  • Type safety: Compile-time verification of available methods
  • Extensibility: Easy to add new mixins without modifying existing classes