Docs

Testing

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

These guides show you how to test the server-side behavior of Flow applications 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 a Vaadin 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. Keep end-to-end tests for what only a browser can show, such as the login flow.

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, and the view itself with end-to-end tests, or with the JavaScript tools described in Testing in the Hilla reference.

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

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 –