开发者

Preparing data for a SpecFlow scenario [closed]

Closed. This question is opinion-based. It is not currently accepting answers.

Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.

Closed 6 years ago.

Improve this question

I'm going to test a complex scenario which expects several other steps to have performed prior to it.

For example , it can be equivalent to have proper data in a warehouse before goods are taken our from it. So in order for fetching to happen, it must first be made sure that there are products in the warehouse and there is a fetch-order. There may be seperate screens to insert products to the wa开发者_如何学Crehouse. So before I start testing the fetch scenarios i have to be ready with those.

What would be the best method to be ready with this data? I basically could think of two options.

  1. Go through the actual screens to prepare the data.

  2. Have a DB snapshot with prepared data to perform the wanted scenario.

I'm not sure which way I should move forward and would like to hear similar experiences from the people who have tried something like this.


The other thing you could do is have a framework that inserts that data into the database. This way it can be reused in other scenarios and would be quicker than restoring a database every scenario


I would go with option 2 - you are testing some use case and you should not involve use cases tested by another tests. Test consists of some code driving the test and data used to perform the test. So if you need special data for the test you should have them prepared upfront instead of creating them by application logic.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜