Skip to main content

Drama Finder

Type-safe Playwright element wrappers for testing Vaadin applications. Find elements using accessibility-first patterns and test with confidence.

Quick Start

Get up and running with Drama Finder in minutes

1

Add the dependency

Add Drama Finder to your Maven project’s test dependencies:
pom.xml
<dependency>
  <groupId>org.vaadin.addons</groupId>
  <artifactId>dramafinder</artifactId>
  <version>1.1.0</version>
  <scope>test</scope>
</dependency>
2

Create a test class

Extend AbstractBasePlaywrightIT to get automatic Playwright setup:
SimpleViewIT.java
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
public class SimpleViewIT extends AbstractBasePlaywrightIT {
  
  @LocalServerPort
  private int port;
  
  @Override
  public String getUrl() {
    return String.format("http://localhost:%d/", port);
  }
}
3

Write your first test

Use element wrappers to interact with Vaadin components:
@Test
public void testLogin() {
  TextFieldElement username = TextFieldElement.getByLabel(page, "Username");
  PasswordFieldElement password = PasswordFieldElement.getByLabel(page, "Password");
  ButtonElement submit = ButtonElement.getByText(page, "Login");
  
  username.setValue("admin");
  password.setValue("secret");
  submit.click();
  
  // Assert navigation to dashboard
  assertThat(page).hasURL(Pattern.compile(".*/dashboard"));
}
4

Run your tests

Execute integration tests with Maven:
mvn verify
[INFO] Running SimpleViewIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

Key Features

Everything you need for robust Vaadin testing

Type-Safe Wrappers

40+ typed element classes for Vaadin components with compile-time safety

Accessibility-First

Find elements using ARIA roles and accessible names, just like assistive technologies

Auto-Retry Assertions

Built-in assertions that automatically retry until timeout, eliminating flaky tests

Shadow DOM Support

Automatic shadow DOM piercing with scoped element lookups

Mixin Interfaces

Shared behaviors through composable interfaces like HasInputFieldElement

Spring Boot Ready

First-class integration with Spring Boot test framework

Explore by Topic

Deep dive into Drama Finder concepts and patterns

Element Lookup

Learn how to find elements using factory methods and ARIA roles

Assertions

Master assertion patterns with automatic retry logic

Locator Patterns

Understand locator delegation and scoped lookups

Best Practices

Follow proven patterns for maintainable tests

Common Patterns

Explore real-world testing scenarios

Troubleshooting

Solutions to common issues

Ready to write better tests?

Start testing your Vaadin application with type-safe, accessibility-first element wrappers.

Get Started Now

Build docs developers (and LLMs) love