maven
The Maven folder contains version of the Vaadin TestBench libraries that you can install in your local Maven repository. Please follow the instructions in Section 23.5.5, “Executing Tests with Maven”.
vaadin-testbench-recorder
This folder constains the Vaadin TestBench Recorder, which you can install in Firefox. Please follow the instructions in Section 23.2.6, “Installing the Recorder”.
vaadin-testbench-standalone-3.1.0.jar
This is the Vaadin TestBench library. It is a standalone library that includes the Selenium WebDriver and many other required libraries.
vaadin-testbench-standalone-3.1.0-javadoc.jar
This is the JavaDoc API documentation for the TestBench library. If you use Eclipse, you can associate the JAR with the TestBench JAR in the project preferences, in the build path library settings.
23.2.5. Example Contents
The example/maven folder provides a number of examples for using Vaadin TestBench. The source code for the application to be tested, a desktop calculator application, is given in the src/main/java subfolder.
The tests examples given under the src/test/java subfolder, in the com/vaadin/testbenchexample package subfolder, are as follows:
SimpleCalculatorITCase.java
Demonstrates the basic use of WebDriver. Interacts with the buttons in the user interface by clicking them and checks the resulting value. Uses By.id() to access the elements.
LoopingCalculatorITCase.java
Otherwise as the simple example, but shows how to use looping to produce programmatic repetition to create a complex use case.
ScreenshotITCase.java
Shows how to compare screenshots, as described in Section 23.6, “Taking and Comparing Screenshots”. Some of the test cases include random input, so they require masked screenshot comparison to mask the random areas out.
The included reference images were taken with Firefox on Mac OS X, so if you use another platform, they will fail. You will need to copy the error images to the reference screenshot folder and mask out the areas with the alpha channel as described in Section 23.6.3, “Taking Screenshots for Comparison”.
SelectorExamplesITCase.java
This example shows how to use different selectors:
•By.id() - selecting by identifier
•By.xpath() - selecting by an XPath expression
VerifyExecutionTimeITCase.java
Shows how to time the execution of a test case and how to report it.