vitalets / playwright-bdd

BDD testing with Playwright runner
https://vitalets.github.io/playwright-bdd/
MIT License
287 stars 33 forks source link

Question:Tag specific examples of a Scenario Outline #144

Closed andreasnovak closed 5 months ago

andreasnovak commented 5 months ago

I would like to add tags to specific examples of a Scenario Outline. Currently it only seems possible to add tags to the entire Scenario Outline so that all examples have the same set of tags. But if example 1 is supposed to have different tags than example 2 of the same Scenario Outline, I do not see a way to achieve this. Or is there a way?

Thank you!

vitalets commented 5 months ago

You can tag specific examples. Just note that by Gherkin syntax you need to write another Examples keyword and tag it:

  Scenario Outline: Scenario with examples
    Then step <value>

    @mobile
    Examples:
      | value |
      | 1     |
      | 2     |

    @desktop
    Examples:
      | value |
      | 3     |
andreasnovak commented 5 months ago

Ah great, thank you so much for the advice @vitalets !