In this example you can see, how to right a UI only test with Java and maven. Before execute the tests please check if the following preconditions are provided:
- Read the Concept of Sakuli
- Ensure that all needed installation packages of your client are installed:
- Read the introduction of Maven Execution type.
After all is done you can execute:
mvn clean test
By default only the test what fits to your OS will executed, see AbstractSakuliUiTest#isTargetEnvironment
If your local OS won't fit to the defined screenshots under src/test/resources/org/sakuli/example
you can use for a quick first running test the attached predefined vagrant vm defined in the Vagrantfile
To get a clear result without unwanted influence of box shadows or some other graphic effects, the Vagrantfile
will install the so called gnome-session-flashback. To ensure that the correct UI session is used, vagrant will shutdown the VM after the installation.
vagrant up --provision
Start Ubuntu VM and open a terminal:
vagrant up --provision
Open the shared project folder and start the tests via maven
cd /vagrant
mvn clean test
See test case running!