你如何使用MSTest的命令行运行SpecFlow的情景? [英] How do you run SpecFlow scenarios from the command line using MSTest?

查看:650
本文介绍了你如何使用MSTest的命令行运行SpecFlow的情景?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有Visual Studio 2010中,我们有我们的合作两个V解决方案。第一个是该web应用程序,第二个是严格SpecFlow测试。具有同时运行只是运行SpecFlow特点是吃所有可用的RAM导致事情慢下来的Visual Studio的两个实例。

I've got Visual Studio 2010, and we have two VS solutions we work with. The first is the web application, and the second is strictly for SpecFlow tests. Having two instances of Visual Studio running at the same time just to run SpecFlow features is eating all the available RAM causing things to slow down.

我已经做了一些关于搜索谷歌和这里的计算器,加细读对MSTest的命令行工具的MS文档,但我还没有找到答案。全SpecFlow测试套件,大约需要45分钟完成,我真的只需要运行几个方案。

I've done some searching on Google and here on StackOverflow, plus perused the MS documentation on the MSTest command line tool, but I haven't found the answer. The full SpecFlow test suite takes ~45 minutes to complete, and I really only need to run a few scenarios.

我想知道是否有运行个人SpecFlow方式功能,甚至个别情况下,使用MSTest的命令行?

I was wondering if there is a way to run individual SpecFlow features, and even individual scenarios, from the command line using MSTest?

推荐答案

现场specflow测试背后,都只是普通MSTest的单元测试。所以,你应该能够使用类似运行它们以同样的方式:

Behind the scene specflow tests are just regular mstest unit tests. So you should be able to run them the same way using something like:

要运行特定方案:

mstest /testcontainer:tests.dll /test:GivenMyScenarioWhenIDoSomeStuff

要运行一些特定情况下,您可以使用/测试标志多次:

To run a several specific scenario you can use the /test flag multiple times:

mstest /testcontainer:tests.dll /test:GivenMyScenarioWhenIDoSomeStuff /test:GivenMyScenarioWhenIDoSomemthingElse

要运行的特征

mstest /testcontainer:tests.dll /test:MyFeatureName

如果您使用@mytag例如您的场景添加标签,你也可以使用该选项

If you add tags on your scenarios using @MyTag for example, you could also use the option

/category:MyTag to filter down the scenarios to run.

请看看你的特征文件背后的生成的代码来获取怎么会事的线索实际上工作中,如果你是familliar与MSTest的它应该是相当简单的。

Please have a look to the generated code behind of your feature files to get a clue of how things actually work, if you are familliar with mstest it should be pretty straightforward.

这篇关于你如何使用MSTest的命令行运行SpecFlow的情景?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆