vscode-cucumber icon indicating copy to clipboard operation
vscode-cucumber copied to clipboard

Additional Snippets

Open stevejpurves opened this issue 9 years ago • 4 comments

Add snippets for And and But steps

stevejpurves avatar Jul 31 '16 08:07 stevejpurves

@stevejpurves Can you give an example of how a snippet for And and But would work?

dialex avatar Feb 28 '18 09:02 dialex

Do you mean in a spec or implementation?

In a spec I think And/But are interchangable, and just down to readability. Both do that same job of avoiding repetition of the previous primary keyword Given/When/Then.

The Gherkin spec shows them as indented to another level , but I've not done that in practice myself. Others may have that preference. So basically it is transforming

Scenario: Some determinable business situation
  Given some precondition
  Given some other precondition
  When some action by the actor
  When some other action
  When yet another action
  Then some testable outcome is achieved
  Then something else we can check happens too
Scenario: Some determinable business situation
  Given some precondition
    But some other precondition
  When some action by the actor
    And some other action
    And yet another action
  Then some testable outcome is achieved
   But something else we can check happens too

Implementation wise there is some additional indenting but otherwise it is just the same behaviour as the Given/When/Thens

prefixes and and but would work?

stevejpurves avatar Mar 06 '18 21:03 stevejpurves

@dialex, i've created code snippets for syntax in the pt-br language, can I contribute?

gabrielsimas avatar Apr 19 '19 22:04 gabrielsimas

@gabrielsimas I think we already have the code snippets for pt-br. Check https://github.com/euclidity/vscode-cucumber/issues/14#issuecomment-372035141. The tricky part is developing a mechanism that allows multiple languages in the same extension. Pull Requests are welcomed ;)

dialex avatar Apr 27 '19 08:04 dialex