Cypress-cucumber-preprocessor: [feature request] use tags for example tables for scenarios with more example tables

Created on 29 Jul 2019  路  27Comments  路  Source: TheBrainFamily/cypress-cucumber-preprocessor

When 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.

enhancement help wanted released

Most helpful comment

:tada: This issue has been resolved in version 4.2.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

All 27 comments

Hey @jimmy882 . I believe we use the same tag-expressions, but since we are running things through cypress as basically dynamically-created mocha tests our implementation of how we deal with tags is custom (and a reason for lack of features and problems). I don't have any issues with what you are suggesting, and might get around to it one day, but it's not high on my list of priorities, since none of our clients requested this so far.

I'd love to take a PR though!

Hi @lgandecki , I'm wanting to run exactly the same scenario as @jimmy882 to express different outcomes in different environments, but have found the same problem.

I tried to trick it by setting a @all tag on the Scenario Outline and @e2e on the examples, and then set my TAGS env to @all and @e2e, but that didn't work either.

At the moment I'll have to copy the scenario outline and give it a different tag as a workaround

Looking for the same feature, is there any workaround, please?

Also need this functionality with tagged examples. any news?

Also looking for this functionality, bump.

We are also looking for this solution. Is there a beta version we can use to help test?

we need that in our company!

This feature would be great. bump

This feature would be very interesting, does anyone have any workarounds?

It would be awesome to have this feature, did anyone thought on a workaround?

this is what exactly I needed for a scenario. Appreciate help on this feature

Any update on this feature request. It would be very helpful if this feature is implemented

This will be really helpful. Kindly share if there is any workaround for now.

If at some point this feature will be implemented, that would be really great, thank you!!

We would really appreciate if this feature can be implemented. Kindly share if there is any workaround for now.

Hello.. Any update when will this be merged? Thank you for adding this feature in first place

Hello @RitikaGhosh15 , this is an issue not a PR, do you mean any specific PR you would like to be merged? The #557 ?

@lgandecki ohk, i assumed it to be a new feature. Actually i am trying to run tags attached to examples in cypress-cucumber-preprocessor with command but its not considering the example tag and running both the examples

npx cypress open --env env=devint TAGS='@mobile and @reg'

image

This is exactly the usecase we had for our porject, that's why I made #557 to solve this, and in the mean while live up to the gherkin specs that says it should be possible.

Would be great to have this feature, currently there is no workaround :( If someone has one, please share!

This is quite a huge setback for my project too. :(

there is work started here if you guys would like to contribute and help pushing this through the finish line:
https://github.com/TheBrainFamily/cypress-cucumber-preprocessor/pull/557

@RitikaGhosh15, are you sure about the correctness of syntax of the command line you used?

npx cypress open --env env=devint TAGS='@mobile and @reg'

This will ignore your tags, thus should be:

npx cypress open --env env=devint --env TAGS='@mobile and @reg'

@RitikaGhosh15, are you sure about the correctness of syntax of the command line you used?

npx cypress open --env env=devint TAGS='@mobile and @reg'

This will ignore your tags, thus should be:

npx cypress open --env env=devint --env TAGS='@mobile and @reg'

Hi rkrisztian ,
I tried with the new command too but no success.
with the new command its still considering @mobile and @smoke even when i pass TAGS='@mobile and @reg'

my requirement is if i pass TAGS='@mobile and @reg', it should pick example under reg and not smoke.

:tada: This issue has been resolved in version 4.2.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

hello @lgandecki ,
As per the commit https://github.com/TheBrainFamily/cypress-cucumber-preprocessor/commit/2789e0b434ec9a1a360e39d864d9e020f1b028ac
if tags are reversed in position, will it still work?
as for me if i remove tag from example 1 and put it on example 2 and run the command (npx cypress open --env env=dev --env TAGS='@desktop and @tag2'), its not working as expected.

Please help me to understand where am i going wrong

image
image

I am also having the same issue as @RitikaGhosh15
Can someone please help?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

leegee picture leegee  路  4Comments

EmmanuelDemey picture EmmanuelDemey  路  5Comments

csuzw picture csuzw  路  7Comments

flowt-au picture flowt-au  路  3Comments

badeball picture badeball  路  5Comments