Maven running cucumber specific feature files or folders
I changed my approach, and decided to use tags instead.
Now, I run a command that tells me which tags to use and I make sure to put a special tag at the beginning of the feature file.
My command now looks like:
mvn install -Dcucumber.options="--tags @runThis --tags ~@ignore --format json-pretty:target/cucumber-report-myReport.json --format html:target/cucumber-html-report-myReport"
The tag I put is @runThis and the ~@ignore is to tell cucumber not to run the @ignore tags.
I also create a different report for each run, so Jenkins cucumber plugin can create a single report from all the different runs and they don't overwrite each other.
I hope this helps.
How to target specific Cucumber runner classes or feature files within Jenkins?
You can tag your test cases and maven will be able to run them by these tags.
For example, When I have Login cases with @Login
tags and I want to run them with Maven
, I am using the following terminal script :
mvn clean test -Dcucumber.options="--tags @Login"
Related Topics
Split Comma Separated Values in Java, Int and String
How to Persist a Property of Type List<String> in Jpa
Where Does Gradle Save Dependencies' Jars
Simplifying the If-Else Condition Using Java Functional Style Programming
Unable to Deploy Spring Boot 2 Application Due to Hikaripool Exception During Pool Initialization
How to Evaluate a Math Expression Given in String Form
How to Exclude Classes from Test Coverage Using Java Annotations in Spring Boot
Gradle Java9 Could Not Target Platform: 'Java Se 9' Using Tool Chain: 'Jdk 8 (1.8)'
Java Error - Illegal Modifier for Parameter - Only Final Permitted
Java Xmlbeans Throws Nosuchmethod Error
Password Validate 8 Digits, Contains Upper, Lowercase, and a Special Character
Java: Getting a Substring from a String Starting After a Particular Character
Spring Boot @Autowired Environment Throws Nullpointerexception
How to Find Max Date in List<Object>
Spring Boot Required Request Part 'File' Is Not Present