Running the tests or features from the command line or terminal without using the IDE or GUI.
Why
No dependency on IDE or GUI
Useful in integrations with other processes like CI/CD or deployment or release process. It will be easier and faster with command-line execution. It also consumes less memory.
When:
Whenever you need any batch or scheduled execution
1. Running a feature
mvn test -Dcucumber.options="src\test\resources\features\demo.feature"
2. Running a scenario in a feature file
mvn test -Dcucumber.options="src\test\resources\features\demo.feature:6"
3. Running with tags:
mvn test -Dcucumber.options="--tags @regression"
Or
mvn test -Dcucumber.options="-t @regression"
4. Reports
mvn test -Dcucumber.options="--plugin html:target/HtmlReport"
Or
mvn test -Dcucumber.options="-p html:target/HtmlReport"
5. Multiple options
mvn test -Dcucumber.options="src\test\resources\features\demo.feature:6" -Dcucumber.options="-p html:target/HtmlReports"
No comments:
Post a Comment