Browserless Testing
|
Note
| Browserless testing was previously known as UI Unit Testing and required a commercial TestBench subscription. Browserless testing is free for all users. |
Browserless testing removes the need to run a browser or a servlet container, making it much faster to test your Vaadin-based applications.
With browserless testing, you look up components directly from UI.getCurrent(), bypassing the browser and the client-server communication bridge. You call methods directly on your server-side view classes and Vaadin components.
You also don’t need to launch a servlet container. The BrowserlessTest class creates the Vaadin session, the UI, and other necessary Vaadin classes directly in the JVM that runs your JUnit tests.
In addition to browserless testing, Vaadin also allows you to write end-to-end tests for your applications. Each approach has its own advantages.
Start by choosing your application framework for setup and a runnable example. The following pages describe APIs, lifecycle guarantees, and integration behavior.
Topics
- Test Environment and Lifecycle
- Browserless test base classes, environment lifecycle, route scanning, navigation, and simulated server round trips.
- Component Testers
- Tester selection, supported actions, usability checks, constraints, and custom tester discovery.
- Querying Components
- Details and examples on accessing components within a browserless test.
- Component Locators
- Typed component locator entry points, filters, resolution caching, custom locators, and opt-in interfaces.
- Testing Overlay Components
- How to test context menus, menu bars, and other overlay-based components in browserless tests.
- Spring Security Integration
- Authentication timing and navigation access-control requirements for Spring browserless tests.
- UI Snapshots
- Failure snapshot extension behavior and the format of server-side component tree output.
- Application, User, and Window Contexts
- Browserless context ownership, thread affinity, window activation, security isolation, factories, and configuration.
- Signal Test Environment
- Signal propagation, background task processing, shared-signal updates, and write confirmation in browserless tests.
- CDI Test Integration
- Lifecycle ordering, CDI bean discovery, scopes, servlet integration, and route registration in Weld-based browserless tests.
- JUnit 6 Extensions
- Composition-based browserless test setup, per-method and per-class lifecycles, and extension configuration.
- Test Configuration
- Set Vaadin application properties, feature flags, and Lookup services for a single test class or test method.
- Quarkus Integration
- Quarkus browserless test initialization, dependency injection, test profiles, and security integration.
- Environment Differences
- What the browserless environment creates, in which order, and which application behavior therefore needs a different approach in a test.
|
Note
| Java EE / Jakarta EE applications using Vaadin CDI need a Weld-backed test environment and a CDI servlet. See CDI Test Integration for the lifecycle and framework boundaries. |
17590340-7B0A-463B-846B-FEDB1F1AE1B3