Migrating to Vaadin 10

Introduction

Vaadin TestBench is part of the Vaadin platform 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 Framework 8 and TestBench 4 for Vaadin Framework 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 Framework "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 Framework and Vaadin platform

If you have an application which is using both a Vaadin Framework version and a Vaadin platform 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 the Vaadin Framework tests and a new version for the Vaadin platform 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 platform. You should instead run using headless Chrome (using --headless --disable-gpu) or using headless Firefox (using -headless).