I wanted to run Cucumber Feature file based on the Test case ID that scanerio name contains.
I know we can use @CucumberOptions 'features' tag and specify the line number to execute e.g "src/test/resources/Folder/myfile.feature:7:12" This will run scenarios at line 7 and 12. But i wanted to run based on the TC ID.
Below is the feature file code
@Run Feature: Login Functionality Scenario: First Test Case(TC.No:1) Given I perform action 1 Scenario: Second Test Case(TC.No:2) Given I perform action 2 Scenario: Third Test Case(TC.No:3) Given I perform action 3 Scenario: Fourth Test Case(TC.No:4) Given I perform action 4 Scenario: Fifth Test Case(TC.No:5) Given I perform action 5
All the scenario's are in a single feature. For the feature file code above i wanted some way through which i can execute based on TC Id. E.g I only want to execute TC1,TC2 and TC5( TC id's picked up from scenario names).
There is a property file that contains the TC Id's to be executed. My code should read the file and then execute only those TC id's. This can help me in reducing the number of automation TC's to be run. Is it possible?