Docs

Documentation versions (currently viewingVaadin 24)

UI Unit Testing

Explains the value of UI unit testing, to test Vaadin applications faster.
Note
Commercial feature

A commercial Vaadin subscription is required to use TestBench in your project.

UI unit testing removes the need to run both the browser and the servlet container, to test more quickly your Vaadin-based applications.

TestBench UI unit testing is browser-less. Therefore, you would look up components straight from UI.getCurrent(), bypassing the browser and the JavaScript → server bridge. You’d call methods directly on your server-side view classes and on the server-side Java Vaadin components.

Because UI unit testing is also container-less, you don’t need to launch the servlet container. The UIUnitTest class handles creating the Vaadin session, the UI and other necessary Vaadin classes right in the JVM that runs your JUnit tests.

In addition to UI unit testing, TestBench also allows you to write end-to-end tests for your Vaadin applications. Each approach has their own advantages.

Topics

Getting Started
Tutorial to create and run a UI unit test.
Querying Components
Details and examples on accessing components within a UI unit test.
UI Snapshots
About the snapshots returned by a failing UI Unit Test.
Spring-based Projects
Describes and provides examples how to perform UI Unit Tests.
Quarkus-based Projects
Describes and provides examples of how to perform UI Unit Tests.
Note
UI unit testing isn’t supported in Java EE based projects due technical limitations in Weld JUnit 5 extension. Use instead End-to-End testing.

17590340-7B0A-463B-846B-FEDB1F1AE1B3