Docs

Testing

Write tests for your application, verify user interactions, and diagnose failures.

These guides show you how to test the server-side behavior of Flow views using browserless tests. Start by choosing the setup for your application framework, then choose a guide for the behavior you need to verify.

Browserless tests run against Java components without a browser. Use browser-based tests when you need to verify rendering, client-side behavior, or real browser interactions. See the testing reference for a comparison of the approaches.

Choosing What to Test

Each layer of your application is tested in its own way. The following table shows where to find guidance for each:

What you test Kind of test Guidance

Application services and their rules, including access control

Spring integration tests that call the service

Test the Service in the tutorial, Testing Method Security, and Testing Record Rules

Queries, migrations, and the database schema

Integration tests against the same database as in production

Add Testcontainers, and Testcontainers in the Spring Boot documentation

Flow views

Browserless tests

The guides listed below

Rendering, client-side behavior, and the whole application in a browser

End-to-end tests

End-to-End Testing and Testing with Playwright

Service and browserless tests are fast and don’t need a browser, so they can cover most of your application, including its use cases from start to finish. Keep end-to-end tests for what only a browser can show, as described in Keep a Thin Layer of Browser Tests.

Browserless tests can’t test React views, because React views run in the browser. Test the browser-callable services of a React view like any other application service. Test the view itself with end-to-end tests, or with the JavaScript tools described in Test React Views.

To run the tests on every change, see Build on CI.

Choosing a Test for a Feature

Browserless tests cover most features of Flow views. Some features need a simulator or a test double in place of the browser or an external service, and others need a real browser. The following table shows the kind of test for features where the choice isn’t obvious:

Feature Kind of test Guidance

Signals and component bindings

Browserless tests

Test Signal-Based Views

Shared signals between users

Browserless tests, with a window for each user

Share Signals between Users

Geolocation

Browserless tests, with the geolocation simulator in place of the browser

Testing on the Geolocation page

Master-Detail Layout

Browserless tests for the content of the master and detail areas. End-to-end tests for whether the layout shows the detail area as an overlay, which depends on the space in the browser.

Component Testers

Slider

Browserless tests

Component Testers

Message List attachments

Browserless tests

Component Testers

AI integration, such as a chat built with the AI Orchestrator

Browserless tests, with a scripted LLM provider in place of the model

Test AI-Powered Views

Clipboard

End-to-end tests. The browser copies, reads, and pastes, and browserless tests have no clipboard simulator.

End-to-End Testing and Testing with Playwright

Keep a Thin Layer of Browser Tests

Browserless tests prove behavior, not rendering. They can’t show that:

  • the theme and the CSS look right,

  • the client-side JavaScript of a component works,

  • the layout works in real browsers and at different screen sizes, or

  • add-ons and custom components render.

Keep a few end-to-end tests in a real browser for these, also as a safety net when you upgrade Vaadin or an add-on. Typical smoke tests check that:

  • the most important views open,

  • custom components and add-ons render,

  • the browser console shows no JavaScript errors,

  • the login flow works, and

  • each kind of gesture, such as drag and drop, reaches the server-side code that handles it; see Design Gestures for Testing.

Don’t repeat the use cases in the browser tests: the rules behind them belong in the faster browserless tests. A component with client-side code of its own also needs browser tests for that code, in the component’s own module.

Guides

Browserless Testing
Choose the browserless test setup for Spring Boot, Java EE/CDI, Quarkus, or plain Java, then test your Flow views.

3E1E2938-89FF-4EFD-9EE2-658369A06F3A

Updated –