开发者

How to identify scenarios and steps with numerical ids on cucumber?

开发者 https://www.devze.com 2023-03-06 17:01 出处:网络
Looking into a nice approach for identifying scenarios and steps with numerical ids on cucumber Don\'t want to use code line number for this, that can change after editing features.

Looking into a nice approach for identifying scenarios and steps with numerical ids on cucumber

  • Don't want to use code line number for this, that can change after editing features.
  • I'm already using tags to identify/group scenarios but customer requires a unique number to refer them.
  • Ideal solution would take care of this automagically perhaps a cucumber gem with some sort of persistence support.

As of now, i will simply use tags with hard-coded numerical ids on it, e.g.

@login @tc10100
Scenario: Login with wrong credentials
  Given I am not logged in
  And I go to the user signin page
  #and so on...

Notes about this temporary tagged (@tc10100) solution:

  • tc stands for Test Case (customer is accustomed t开发者_如何学Co that term)
  • 10100 is just some initial case number
  • since a good designed scenario will not include more than 9 steps, step numbers will be counted automatically, starting on step 1, 2, 3... So @tc10100 step 2 is "And I go to the user signin page"


The best solution here may be create scenarios ids based on the scenario's name.

Do you have a any kind of constraints about the id max length ?

If not we can start thinking about some sort of scenario unique hash applying md5 or something like that to the scenario's name.

0

精彩评论

暂无评论...
验证码 换一张
取 消