Is there a way to run Specflow scenarios in desired order (C# Selenium)?

放肆的年华 提交于 2019-12-06 10:19:58

问题


I'm trying to run multiple Specflow tests in the Test Explorer, but the challenge is I'm unable to run them in the desired order.

ex - I have 3 scenarios in my feature files:

  • Login positive
  • Login negative
  • registration positive

Currently, they run in random order. I want them to always run in the above order. How can I configure my feature files to make it possible?


回答1:


For NUnit: Tests inside a scenario run in alphabetical order, so if you want to run them in specific order just rename scenarios like

Scenario: 1 Login positive
Scenario: 2 Login negative
Scenario: 3 Registration positive

For other frameworks look here: https://www.ontestautomation.com/running-your-tests-in-a-specific-order/



来源:https://stackoverflow.com/questions/49943099/is-there-a-way-to-run-specflow-scenarios-in-desired-order-c-selenium

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!