Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CCK: Add example with parameterized scenario outline name #96

Closed
mpkorstanje opened this issue Feb 23, 2024 · 0 comments · Fixed by #98
Closed

CCK: Add example with parameterized scenario outline name #96

mpkorstanje opened this issue Feb 23, 2024 · 0 comments · Fixed by #98

Comments

@mpkorstanje
Copy link
Contributor

mpkorstanje commented Feb 23, 2024

🤔 What's the problem you're trying to solve?

In Gherkin it is possible to have scenario outlines with a parameterized name.

For example:

Feature: Examples Tables
  Sometimes it can be desirable to run the same scenario multiple times with
  different data each time - this can be done by placing an Examples table underneath
  a Scenario, and use <placeholders> in the Scenario which match the table headers.

  Scenario Outline: Eating <eat> cucumbers
    Given there are <start> cucumbers
    When I eat <eat> cucumbers
    Then I should have <left> cucumbers

    Examples: These are passing
      | start | eat | left |
      |    12 |   5 |    7 |
      |    20 |   8 |   12 |
      |    20 |   9 |   11 |      

The pickles would then be named

  • Eating 5 cucumbers
  • Eating 8 cucumbers
  • Eating 9 cucumbers

✨ What's your proposed solution?

Add another, separate example with an example table that uses a parametrized scenario outline name.

📚 Any additional context?

This showed up with cucumber/junit-xml-formatter#27.

mpkorstanje added a commit that referenced this issue Jun 21, 2024
When using a Scenario Outline it is possible to use a placeholder in the
name of that Scenario Outline. The resulting pickle will have the
placeholder replaced with a value from the example tables.

This allows us to test use cases where this matter such as:
- cucumber/junit-xml-formatter#34
- cucumber/testng-xml-formatter#4

Fixes: #96
mpkorstanje added a commit that referenced this issue Jun 22, 2024
When using a Scenario Outline it is possible to use a placeholder in the
name of that Scenario Outline. The resulting pickle will have the
placeholder replaced with a value from the example tables.

This allows us to test use cases where this matter such as:
- cucumber/junit-xml-formatter#34
- cucumber/testng-xml-formatter#4

Fixes: #96
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant