Browserless Testing
Browserless tests exercise Flow views and components in the test JVM. Choose the setup that matches your application’s dependency injection framework before writing a test.
Choose Your Framework
Application | Setup Guide | Test Environment |
Spring Boot | Start with Set Up Browserless Tests with Spring Boot |
|
Java EE / Jakarta EE with Vaadin CDI | An application-owned | |
Quarkus |
| |
Plain Java without a dependency injection container |
|
The CDI guide uses Jakarta packages (jakarta.*), as used by current Vaadin applications.
Quarkus has its own integration even though it also uses CDI concepts.
Keep the Framework Setup with the Test
Use one setup path for each test class. Keep that path’s base class, dependencies, lifecycle hooks, and bean configuration when adapting an interaction example.
-
Spring Boot tests use Spring configuration and Spring Security test annotations where applicable.
-
Java EE/CDI tests use a Weld test archive, CDI producers, scopes, and alternatives. They extend the CDI-aware base class from the CDI guide. Adding Spring annotations or
browserless-test-springdoes not configure CDI. -
Quarkus tests use Quarkus test profiles and security annotations.
-
Plain Java examples construct components without a dependency injection container. Extending
BrowserlessTestalone does not enable CDI injection.
Methods such as navigate(), find(), and test() are shared interaction APIs.
A shared method does not make the surrounding framework setup interchangeable.
The task guides identify their example setup and explain which parts to keep when using CDI.
Guides
- Set Up Browserless Tests with Spring Boot
- Set up a Spring Boot project, write a browserless test for a Flow view, and run it from your IDE or Maven.
- Set Up Browserless Tests in Plain Java
- Configure browserless tests in a plain Java project using a base class or a JUnit extension.
- Set Up Browserless Tests with Java EE/CDI
- Use Weld and Vaadin CDI to inject dependencies into browserless view tests, select test alternatives, and manage the test lifecycle.
- Set Up Browserless Tests with Quarkus
- Configure Quarkus browserless tests, create a test class, and substitute services using test profiles.
- Configure a Browserless Test
- Set Vaadin properties and feature flags for individual browserless tests while retaining the correct framework setup.
- Test User Interactions
- Find components, simulate navigation and keyboard shortcuts, and test menu actions in browserless tests.
- Test a Custom Component
- Test a component without a route, add a reusable component tester, and encapsulate interactions in a custom locator.
- Test View Access Control
- Verify anonymous, authorized, and unauthorized navigation in Spring and Quarkus browserless tests.
- Test Signal-Based Views
- Assert changes to signal bindings, process background updates, and verify shared-signal write confirmation.
- Test Multiple Users and Windows
- Verify shared state, independent windows, and authentication isolation across several browserless user sessions.
- Debug a Failing Browserless Test
- Enable failure snapshots, inspect component state, and fix a failing browserless interaction test.
- Speed Up Browserless Tests
- Reduce scanning and Spring context startup costs, and evaluate shared test environments without losing test isolation.
- Migrate UI Unit Tests to Browserless Tests
- Update UI Unit Testing dependencies and base classes, handle Spring support, and migrate existing JUnit tests.
E6858195-4B1D-43C8-8688-502531C6AC16