Skip to content

Conversation

@Artalus
Copy link

@Artalus Artalus commented Apr 29, 2023

Gherkin Documentation mentions you can uses * (asterisk) to describe lists of things, same way as with And steps:

Scenario: All done
  Given I am out shopping
  * I have eggs
  * I have milk
  * I have butter
  When I check my list
  Then I don't need anything

Dunno if anybody actually needs such feature - since search for asterisk did not yield anything neither in PRs nor Issues. But since the change is literally 1 line of code, I thought I might propose it just as well and see what happens 😄
Not sure if the place for testing it is right (tests/feature/test_steps.py) or if it should be done someplace else tho.


One (perhaps controversial) use-case that comes to mind, which would benefit from asterisks, is something like this:

Given foo '1' is barred
And   foo '2' is barred

When Alice bazzes foo '2'

Then we observe foo '1':
* its 'top' is 'kek'
* ...

Then we observe foo '2':
* its 'top' is 'peck'
* ...

It could be written as Then we observe ... and its ... already, and would definitely be better with something like For foo ... its ... - but I think asterisks might still be a step in right direction.

@jsa34
Copy link
Collaborator

jsa34 commented Oct 7, 2024

@youtux can we close this as it is now done and covered by a test in the test suite?

@Artalus
Copy link
Author

Artalus commented Oct 7, 2024

@jsa34 happy to close this myself! 🙃 For the record, I assume the support was added as a side effect of #698 ?

@jsa34
Copy link
Collaborator

jsa34 commented Oct 7, 2024

@Artalus that's fab, thank you!

Yes, indeed - I also added a separate PR to add a test to cover this to ensure it is meeting the same outcome as this PR in #713

@Artalus Artalus closed this Oct 7, 2024
@Artalus Artalus deleted the support-asterisks branch October 7, 2024 11:30
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.

2 participants