i have 2 scenarios in my feature file and i need to run only 1 scenario, can you please suggest me some mvn test command to do it
if i do :
mvn test -Dcucumber.options="src\test\resources\features\login.feature:9"
it is running both the scenarios, but i need to run only 1 scenarion which is in line 9
This is my feature file : login.feature
Scenario: Check login with valid credentials
Given user is on login page
When user enters valid username and password
And clicks on login button
Then user is navigated to the home page
Scenario: Check login with invalid credentials
Given user is on login page
When user enters invalid username and password
And clicks on login button
Then error message is displayed - Invalid Credentials
Assuming you're on windows and using
cucumber-junityou would use:The quotes start after the
-Dbecause that's just how Windows does qoutes.For the
cucumber-junit-platform-engineuse:Also note that
cucumber.optionsdoesn't exist anymore. For the latest properties see https://github.com/cucumber/cucumber-jvm/tree/main/cucumber-core#properties-environment-variables-system-options