How to test for same feature with multiple backgrounds in cucumber

前端 未结 1 652
小蘑菇
小蘑菇 2021-02-01 04:39

I\'ve got a feature (a .feature file) that are working fine in cucumber.

The background of all the scenarios in the feature just sets up a user, and then logs in as a s

相关标签:
1条回答
  • 2021-02-01 05:12

    If it was me, I would just suck up the duplication:

    http://dannorth.net/2008/06/30/let-your-examples-flow/

    An alternative would be to use a tag on the feature that indicates you want to run the scenarios against both user groups. Then use an Around hook to run the scenario twice, once for each type of user.

    We've talked about things like Background Outlines before, but the conclusion we came to was that it wouldn't be worth the extra complexity to implement it.

    0 讨论(0)
提交回复
热议问题