[feature request] use tags for example tables for scenarios with more example tables
See original GitHub issueWhen I have a scenario with more example tables with different tags:
Scenario Outline: Test example
Given Step with <param1>
When Step with <param2>
Then Result is <result>
@smoke
Examples:
| param1 | param2 | result |
| foo | bar | foobar |
| 1 | 2 | 3 |
@regression
Examples:
| param1 | param2 | result |
| abc | def | abcdef |
| z | y | z |
I would like to run only those examples that are tagged with specific tag, for example @smoke
.
This is possible with pure cucumber-js, do they use different tag-expressions?
According to cucumber documentation:
Tags can be placed above the following Gherkin elements:
- Feature
- Scenario
- Scenario Outline
- Examples
I tried to run cucumber-js and it worked, but when running cypress with cypress-cucumber-preprocessor, I get an error: We could not detect any tests in the above file. Write some tests and re-run.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:19
- Comments:56 (15 by maintainers)
Top Results From Across the Web
java - Cucumber Tagging with Multiple Examples tables in a ...
userdate.feature - amended the Scenario Outline for the example. Scenario Outline: BR001 test Given something When happen Then result "".
Read more >Data Tables in Cucumber - Tools QA
Data Tables in Cucumber. In this example, we will pass the test data using the data table and handle it using Raw() method....
Read more >How to structure a long list of examples with SpecFlow?
Tables are a good solution, and most Given-When-Then tools support listing tables of examples with scenario outlines. Scenario outlines use placeholders ...
Read more >Writing Features - Gherkin Language - Behat
You can use tags to group features and scenarios together, independent of your ... It is replaced with a real value from the...
Read more >Cucumber - Data Tables - Tutorialspoint
Example · Create a feature file, named as dataTable.feature inside the package dataTable (see section scenario outline for more detailed steps). · Write...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@RitikaGhosh15 , @dankopetrovic , PR https://github.com/TheBrainFamily/cypress-cucumber-preprocessor/pull/609 opened.
@jime2003 , I think the env problem should be a separate issue report to keep things focused.
@dankopetrovic , OK, I tried https://github.com/TheBrainFamily/cypress-cucumber-example, although it seems a bit too old. Regardless, after updating the preprocessor to the latest version, I tried to check if we can tag examples individually there and filter for those tags:
CYPRESS_TAGS='@tagS and @tagE2' npm run test
=> Worked.npx cypress run -e TAGS='@tagS and @tagE2'
=> Worked.What did not work:
=> I think the problem is with the
cypress-tags
script, which seems to fail to find tagged examples (it works forTAGS='@tagS
), but your reported errors are different from mine. While I think it makes sense to look into thecypress-tags
script and see why I got this error (which I will try), I think it would be still useful to see an example project that lets me reproduce the exact same issue you guys reported, just to be sure we are dealing with the same error.Edit: I found the problem:
This is just plain wrong when
cypressConf.testFiles
is set to**/*.{feature,features}
. After doing a workaround, I still get a similar error:And that is because the tag filtering script does not take examples into account. This one should be an easy fix.