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

Add example with parameterized Scenario Outline #98

Merged
merged 1 commit into from
Jun 22, 2024

Conversation

mpkorstanje
Copy link
Contributor

@mpkorstanje mpkorstanje commented Jun 21, 2024

🤔 What's changed?

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:

Fixes: #96

🏷️ What kind of change is this?

  • ⚡ New feature (non-breaking change which adds new behaviour)

📋 Checklist:

  • I agree to respect and uphold the Cucumber Community Code of Conduct
  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • Users should know about my change
    • I have added an entry to the "Unreleased" section of the CHANGELOG, linking to this pull request.

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 mpkorstanje force-pushed the include-pickle-name-if-parameterized branch from 49198a6 to d68f54e Compare June 22, 2024 12:24
@mpkorstanje mpkorstanje marked this pull request as ready for review June 22, 2024 12:24
@mpkorstanje mpkorstanje merged commit 0505282 into main Jun 22, 2024
7 checks passed
@mpkorstanje mpkorstanje deleted the include-pickle-name-if-parameterized branch June 22, 2024 12:25
@luke-hill
Copy link
Contributor

luke-hill commented Jul 9, 2024

I'd argue this is a breaking change as it requires changes to my code to make it work. But given it's a small change I can do it.

Any modification to any existing sample file that requires any new steps or changes to existing ones is in theory breaking

@mpkorstanje
Copy link
Contributor Author

Ah. So this should have gone into a separate file?

@luke-hill
Copy link
Contributor

I mean the change you've made is perfectly reasonable.

If it went into a new file, then it wouldn't have been picked up automatically until a separate code change is made here: https://github.com/cucumber/compatibility-kit/blob/main/ruby/spec/cck/examples_spec.rb#L7 - This is because it would have failed the spec.

However, notwithstanding that, it would have been automatically picked up by this method (Assuming we ignore CI): https://github.com/cucumber/compatibility-kit/blob/main/ruby/lib/cck/examples.rb#L9 - which then is used in the compatibility spec in the repo proper to iterate over each sample. It is invoked here: https://github.com/cucumber/cucumber-ruby/blob/main/compatibility/cck_spec.rb#L11

This feels like an interesting discussion / debate though, because maybe almost "any" non-trivial change to the CCK should be propagated as a breaking (and therefore major), change. I am not sure. My gut says it should be. But happy to be swayed if required.

Nevertheless, I released v16 of the cck which had a couple of minor tweaks plus the change to attachments

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 this pull request may close these issues.

CCK: Add example with parameterized scenario outline name
2 participants