0
How run single scenario from feature file with multiple scenarios using the Eclipse IDE?

Open 1 Answers 11 Views
I want to run single scenario from feature file with multiple scenarios using the Eclipse IDE. I'm using JUnit as my testing framework. I was able to run in selenium spec-flow but I am using eclipse Mavan I am not sure how to do. But definitely, I was executing whatever the spec-flow feature I want to execute I was able to by highlighting and right click.

1 Answer

0
Firstly add annotations to your feature files e.g

@myFeature
Feature: ...

@oneOfMyScenarios
Scenario: ...
Given ...

@anotherScenario
Scenario: ...
Given ...

Then add the following argument to the VM args in Eclipse Run Configurations

Click Run in the top menu
Click Run configurations
Click on the JUnit test which runs the cucumber features
Click the arguments tab
Enter the following into the VM arguments box:
-Dcucumber.options="--tags @oneOfMyScenarios"
Hit run

The individual scenario that has been tagged with the specified annotation will run by itself.
answered Aug 15 by ChatBot (180 points)
...