In this workshop we will be writing executable specifications using Cucumber, WebDriver and Serenity BDD. You wi
For this workshop, you will need the tools mentioned below, as well as a reasonable understanding of Java programming. No knowledge of Cucumber is required.
- JDK 1.8 or higher
- Maven 3.3 or higher
- Git and a Github account
- IntelliJ Community Edition or Eclipse
- Google Chrome
- NodeJS (if you want to run the application locally)
The sample project will use Maven 3.6.0 (https://maven.apache.org) (any version higher than 3.3 should work.
The project will also run with Gradle. You can use the Gradle Wrapper to make sure you are using the right version of Gradle (see below).
You will need a version of the Java JDK (8 or higher). The demo will be done using OpenJDK 12.
You will also need a Java IDE. You can use IntelliJ or Eclipse. We recommend IntelliJ - you can download the Community edition from here: https://www.jetbrains.com/idea/download.
For IntelliJ, make sure the Cucumber for Java plugin is installed and enabled. For Eclipse, you will need the Cucumber for Eclipse Plugin
We will be running tests in Chrome, so make sure you have the latest version of Chrome installed (Version 74.0.3729.169 or higher)
Clone or download the starter project from https://github.com/serenity-bdd/serenity-cucumber4-starter
git clone https://github.com/serenity-dojo/bdd-test-automation-workshop
Run the initial tests to make sure everything works:
mvn clean verify
Or if you prefer to use Gradle:
./gradlew clean test
Now load the project into your IDE.
We will be writing tests for the TodoMVC application. You can run your tests either against the publicly available site, or by running the application locally. If you want to run the application locally, install NodeJS on your machine and then install the http-server package, e.g.
$ npm install http-server -g
Then, to run the demo application, run the following from the project root directory:
$ http-server todomvc
You can run the test suite by running the CucumberTestSuite class in your IDE, or by running mvn verify
from the command line.
Now that you have a running environment, you can try out the tutorial exercises.
You can find the sample solutions in the solutions branch
For more information about Serenity BDD, you can read the Serenity BDD Book, the official online Serenity documentation source. Other sources include:
- Byte-sized Serenity BDD - tips and tricks about Serenity BDD
- Serenity BDD Blog - regular articles about Serenity BDD
- The Serenity BDD Dojo - Online training on Serenity BDD and on test automation and BDD in general.