This is the simplest possible build script setup for Serenity BDD using Java.
This is a very minimal sample project using JUnit and Serenity BDD in Java. You can use this project as a quick starting point for your own projects.
Git:
git clone https://github.com/serenity-bdd/serenity-junit-starter.git
cd serenity-junit-starter
Or simply download a zip file.
Open a command window and run:
mvn clean verify
Open a command window and run:
gradlew test
Both of the commands provided above will produce a Serenity test report in the target/site/serenity
directory. Go take a look!
Now import the project into your IDE (be sure to import the project as a Maven or Gradle project). The project structure looks something like this (some less interesting files and directories have been left out):
├── pom.xml 1
├── build.gradle 2
├── src
├── main
├── test 3
├── java
├── starter 4
├── ASimpleTest.java 5
├── steps 6
├── MathWizSteps.java 7
- Maven POM file
- Gradle build script
- Test code
- Root package
- A sample test case
- Step library package
- A sample step library