This is an example of incorporating Geb into a Gradle build. It shows the use of Spock and JUnit 4 tests.
The build is setup to work with a variety of browsers and we aim to add as many as possible. A JenkinsSlave image has been created that can run Chrome/Firefox Headless tests. This offers a viable option for replacing phantomJs in the OpenShift pipeline. Please see the JenkinsSlave Dockerfile setup. This repository also holds a Dockerfile for a CentOS based image that will run headless tests as well.
BDDStack is 100% compatible with the tests that were created in the previous incarnation of the framework called NavUnit (which is now deprecated). Please see the wiki for instructions on how to use your NavUnit Tests in BDDStack.
Please see the Wiki for more details.
The following commands will launch the tests with the individual browsers:
./gradlew chromeTest
./gradlew chromeHeadlessTest //Will run in pipeline as well
./gradlew firefoxTest
./gradlew firefoxHeadlessTest //Will run in pipeline as well
./gradlew edgeTest //only on windows
./gradlew ieTest //Read wiki for set up instructions, only on windows
./gradlew safariTest //Only for MacOS, read wiki for instructions.
To run with all, you can run:
./gradlew test
Replace ./gradlew
with gradlew.bat
in the above examples if you're on Windows.
Gradle source sets
sourceSets {
test {
groovy {
srcDirs = [‘src/groovy’]
}
resources {
srcDirs = [‘src/resources’]
}
}
}
Please ask questions on our Slack Channel and raise issues in BDDStack issue tracker.
http://www.gebish.org/manual/current
https://inviqa.com/blog/bdd-guide
https://github.com/SeleniumHQ/selenium/wiki
SourceSets: