本文介绍了preparing数据的SpecFlow方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要测试一个复杂的方案而预计其他几个步骤已在它之前进行的。

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 warehouse. 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. 穿过的实际画面以prepare数据。

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

有一个数据库快照以prepared数据进行想要的场景。

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.

推荐答案

我会去选择2 - 你正在测试一些用例,你不应该涉及到另一个试验测试用例。测试包括一些code驱动用来进行测试的测试数据。所以,如果你需要特殊的数据的测试,你应该让他们prepared,而不是通过应用逻辑创建它们的前期。

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.

这篇关于preparing数据的SpecFlow方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 23:21