Documentation

Documentation versions (currently viewingVaadin 23)

Migrating to Vaadin 10

Introduction

TestBench is part of Vaadin and is intended to primarily be used to test applications created using the same platform version.

While the features are primarily the same as in TestBench 5 for Vaadin 8 and TestBench 4 for Vaadin 7, the API has been tuned a bit to better match Flow component API and features.

ElementQuery Changes

The ElementQuery method caption(String) has been removed as there is no generic caption concept across all web components. The method state(String,String) was also tied to the Vaadin "shared state" feature and has been removed. A more generic finder method attribute(String name, String value) has been added instead. This can be used to find an element with any given attribute value. The old caption("OK") can in some cases be replaced by attribute("label","OK") and state("something","value") also by attribute("something", "value"), depending on the used component.

The query methods in(), child() and $$() were rarely used and have been removed to simplify the query language.

Element API Changes

The Element API has been made consistent with the API provided by the element (web component) itself. The feature set is largely the same as in older versions but the exact method naming differs in some cases.

Applications using both Vaadin 7/8 and Vaadin 10+

If you have an application which is using both Vaadin 7/8 and later version, you should keep the tests for each version in a separate module in the project. This allows you to use an older TestBench version for Vaadin 7/8 tests and a new version for Vaadin 10+ tests.

Selenium Version

The Selenium version has been upgraded to the latest available version. While it is mostly compatible, some small API changes might require your attention.

PhantomJS

It is no longer recommended to use PhantomJS for headless testing. PhantomJS is lacking behind the latest browser versions in features and will in many cases just not work with Vaadin 10+. You should instead run using headless Chrome (using --headless --disable-gpu) or using headless Firefox (using -headless).

2F1815E6-3F4D-4534-9A86-6A01F3FFD50C