badeball / cypress-cucumber-preprocessor

Run cucumber/gherkin-syntaxed specs with Cypress
MIT License
1.32k stars 149 forks source link

Can't run individual tests using tag - all scenarios from the feature file are executed instead of the one that has the tag #672

Closed andrei-s-buta closed 2 years ago

andrei-s-buta commented 2 years ago

Our automated regression has more than 200 scenarios divided in multiple feature files. Each scenario has a scenarioID tag, regression tag and/or smoke tag

feature1.feature @scenario1 @regression @smoke Scenario: scenario 1 Given When Then

@scenario2 @regression Scenario: scenario 2 Given When Then

@scenario3 Scenario: scenario 1 Given When Then

feature2.feature @scenario4 @regression @smoke Scenario: scenario 1 Given When Then

@scenario5 @regression Scenario: scenario 2 Given When Then

@scenario6 Scenario: scenario 1 Given When Then

....

Current behavior

When I try to run all the scenarios containing @smoke tag or just a specific scenario using its tag @scenario1, cypress runs all the scenario inside the feature file

For e.g:

Desired behavior

For e.g:

Test code to reproduce

Versions

jamiejackson commented 2 years ago

I had the same experience and although I'd like to use this instead of CucumberJS, the inability to use tags prevents my adoption.

badeball commented 2 years ago

From https://github.com/TheBrainFamily/cypress-cucumber-preprocessor/issues/532#issuecomment-805065245

Multiple variables has to be separated by commas, not by specifying -e / --env multiple times. This is simply how the Cypress CLI works. Try this instead.

$ npx cypress-tags run --env TAGS='@fidelity and @regress and not @Ignore',configFile=hlg
badeball commented 2 years ago

By using -e or --env multiple times, only last takes effect.