> Markdown version of [Testing](https://vaadin.com/docs/latest/building-apps/testing). Section index: [llms.txt](https://vaadin.com/docs/latest/building-apps/llms.txt)

# Testing

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](https://vaadin.com/docs/latest/building-apps/testing/browserless.md#choose-your-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](https://vaadin.com/docs/latest/flow/testing.md#comparison) for a comparison of the approaches.

## <a id="choosing-what-to-test"></a>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](https://vaadin.com/docs/latest/getting-started/tutorial/add-tests.md#test-the-service) in the tutorial, [Testing Method Security](https://vaadin.com/docs/latest/building-apps/security/protect-services.md#testing-method-security), and [Testing Record Rules](https://vaadin.com/docs/latest/building-apps/security/protect-services.md#testing-record-rules) |
| Queries, migrations, and the database schema                            | Integration tests against the same database as in production | [Add Testcontainers](https://vaadin.com/docs/latest/building-apps/forms-data/persistence/replace-h2.md#add-testcontainers), and [Testcontainers](https://docs.spring.io/spring-boot/reference/testing/testcontainers.html) 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](https://vaadin.com/docs/latest/flow/testing/end-to-end.md) and [Testing with Playwright](https://vaadin.com/docs/latest/flow/testing/playwright.md)                                                                                                                                                                                                            |

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](https://vaadin.com/docs/latest/building-apps/react.md), 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](https://vaadin.com/docs/latest/hilla/guides/testing.md) in the Hilla reference.

To run the tests on every change, see [Build on CI](https://vaadin.com/docs/latest/building-apps/production/ci.md).

## <a id="guides"></a>Guides

- [Browserless Testing](https://vaadin.com/docs/latest/building-apps/testing/browserless.md): 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`
