Dry running your cucumber test cases
Do you want to quickly check whether the feature files and steps files are written correctly, without really executing them? Cucumber has a quick and cool feature to do so:
build/HelloBDD/HelloBDDSteps > /dev/null &
This command will execute our test application in the background mode. /dev/null
is a null device in Linux OS, and we are redirecting all the unwanted print statements from the HelloBDDSteps
executable to the null device to ensure it doesn't distract us while we execute our Cucumber test cases.
The next command will allow us to dry run the Cucumber test scenario:
cucumber --dry-run
The following screenshot shows the test execution: