-
Notifications
You must be signed in to change notification settings - Fork 253
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
Replace the generic Step function with Given/When/Then functions to match the majority of other languages #545
Comments
Looking at Line 261 in bcffb1c
Given/When/Then . So we can perhaps mark the "preferred" Step func as obsolete.
Concern about terminology: |
@otrava7 thanks - yeah, found it as well now. I'm looking at this more holistically, i.e. can we also replace the generic |
That makes sense to me! |
On a related note, the docs say, at https://github.com/cucumber/godog:
But that doesn't work when go.mod says
|
@seanw2020 Recent changes have not been released as a tagged version yet, however you can go ahead and upgrade to latest |
I'm keen to start working on this. Just checking that no one has started already |
WIP - need yet to update the snippets/generation - tests don't pass
@otrava7 that's great! I've started looking into it to understand the scope and effort a bit more, but very happy for someone else to actually deliver it. Hope the (WIP) branch above helps. |
That's more or less what I was planning to do as well, is there anything else you were looking to do? |
No, that's it. Observations:
|
Could you give an example for this? The Given()/When()/Then() functions are built to only match their respective keyword in the feature files. With the Step() function, it could match no matter the keyword. |
@mirogta One question, Given and When with this approach will match and understand the Given 2 ducks and one hunter
And the hunter is ready for the action -> This will still matching regardless Given, When or Then ?
When the hunter shoots one time
Then "1" ducks left alive |
Hi all, I created a PR that allows us to select a different snippet function for generating missing steps. The two options are now:
steps_func is the default and old behaviour, gwt_func is a new function that generates the steps with the Given/When/Then keywords I intend to add more snippet functions if this PR is merged. For example: I personally would like the functions to be prefixed with the given/when/then keyword as well since Go does not use attributes. Also, I often work with methods on a TestFixture struct. With this PR people can add snippet functions that match their workflow best. |
I'm not sure I understand your question exactly. The line with The
But to your point about "regardless", the following should be invalid:
|
🤔 What's the problem you're trying to solve?
I'm trying to add support for Go (godog) to Cucumber language service, so that we can finally use Go BDD support in VSCode.
It's a bit tricky because of the generic
Step
func and not having the separateGiven/When/Then
funcs instead.Raised a poll here: #542
✨ What's your proposed solution?
Step
function as deprecatedGiven/When/Then
⛏ Have you considered any alternatives or workarounds?
No alternatives considered. I think we should "just" do this to keep the syntax consistent with other programming languages.
📚 Any additional context?
This text was originally generated from a template, then edited by hand. You can modify the template here.
The text was updated successfully, but these errors were encountered: