0

I have a user-signup Scenario, and then I want to use that DB state for two different action flows. Currently I'm doing:

Scenario
  [copy all the whens from user-signup Scenario]
  When ..
  Then action A is complete

Scenario
  [copy all the whens from user-signup Scenario]
  When ..
  Then action B is complete

I'd like to do something like:

Background
  Given user-signup Scenario

Scenario
  When ..
  Then action A is complete

Scenario
  When ..
  Then action B is complete

Note that I don't want to write a method that sets up the user data, because it's complex and varying based on 3rd party API calls (so I can't just insert json records).

Loren
  • 13,903
  • 8
  • 48
  • 79
  • Exactly this same question came up on my project yesterday. Haven't found an answer yet. Could velocity *helpers* help? – Michel Floyd Nov 09 '15 at 23:09
  • This looks like it's just for getting elements and methods https://velocity.readme.io/docs/velocity-helpers – Loren Nov 09 '15 at 23:36
  • So far I've found velocity to be about an order of magnitude more complicated than Meteor itself :( – Michel Floyd Nov 09 '15 at 23:41
  • This is my third time trying it, other times couldn't get it to work. This time seems like it works, just could use a lot of documentation. – Loren Nov 10 '15 at 03:29
  • 1
    It would be interesting to check if the Gherkin syntax itself allows this. – Kyll Nov 16 '15 at 18:46
  • Not seeing anything: https://github.com/cucumber/cucumber/wiki/Given-When-Then https://github.com/cucumber/cucumber/wiki/Feature-Introduction – Loren Nov 16 '15 at 18:54

1 Answers1

0

No, you can't. You could move things into helper functions, or you could switch to mocha e2e with chimpjs, which is better suited. Ref:

https://github.com/xolvio/chimp/issues/147

Loren
  • 13,903
  • 8
  • 48
  • 79