Skip to main content
This guide walks you through creating your first Playwright tests for Vaadin components using Drama Finder.

Basic Test Setup

1

Create a base test class

Extend AbstractBasePlaywrightIT to set up Playwright for your tests:
The AbstractBasePlaywrightIT class handles browser lifecycle, page setup, and Vaadin synchronization automatically.
2

Write your first test

Create a test class for a simple form:
3

Run the test

Execute your integration test:

Working with Text Fields

Drama Finder provides comprehensive support for Vaadin text fields with intuitive methods:

Working with Buttons

Button elements support finding by text and provide assertion methods:

Working with Grids

Drama Finder provides powerful Grid testing capabilities:

Common Assertions

All Drama Finder elements support common assertions:

Element Locators

Drama Finder provides access to internal locators for advanced scenarios:

Factory Methods

Elements provide flexible factory methods for different lookup strategies:

Testing Patterns

Best Practices

Key recommendations for writing Drama Finder tests:
  1. Use accessible names: Prefer getByLabel() and getByText() over CSS selectors
  2. Wait automatically: Drama Finder assertions auto-retry, avoiding flaky tests
  3. Scope your lookups: Use scoped factory methods when testing complex layouts
  4. Test validation states: Always verify both valid and invalid states
  5. Use assertion methods: Prefer assertVisible() over raw Playwright assertions when available
Drama Finder automatically handles Vaadin’s shadow DOM and component lifecycle, so you don’t need to add manual waits or complex selectors.

Next Steps

Element Reference

Explore all available element types and methods

Testing Patterns

Learn advanced testing patterns and best practices

API Documentation

View complete API reference

GitHub Examples

Browse real-world test examples