简体   繁体   English

使用3.4及更高版本的Nunit Console运行Specflow功能文件

[英]Run Specflow Feature file with Nunit Console from 3.4 and above

I need to run my Speflow feature file with Nunit 3.6 console. 我需要使用Nunit 3.6控制台运行Speflow功能文件。 Just need to know how can i run specific feature? 只需要知道如何运行特定功能? As fixure is not supported anymore so just need to know what else can be used? 由于不再支持固定功能,因此只需要知道还能使用什么? Tried --test = but no luck. 尝试--test =但没有运气。

I've tried below command line 我已经尝试在命令行下

%windir%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe "C:\jenkins\workspace\Nunit_ME_Test\Automation\Automation.csproj"


C:\nunit\nunit3.7.0\nunit3-console.exe C:\jenkins\workspace\Nunit_ME_Test\Automation\bin\Debug\Automation.dll --test=ME_NTJ_Include

I have used -test=ME_NTJ_Include where "ME_NTJ_Include" is the feature file .I'm sure something is not right , can any one please help to resolve this . 我使用了-test = ME_NTJ_Include,其中“ ME_NTJ_Include”是功能文件。我确定有些地方不对,任何人都可以帮助解决这个问题。

Thanks 谢谢

To learn exactly how SpecFlow is naming your tests at different levels, simply run all of them and examine the XML result file. 要确切了解SpecFlow如何在不同级别命名测试,只需运行所有测试并检查XML结果文件即可。 The name you find there for FullName is what you would have to use with the --test option. 您在其中找到的FullName名称是--test选项必须使用的名称。 Most likely, you are simply issing the namespace in which the fixture is defined. 最有可能的是,您只是简单地散布了在其中定义固定装置的名称空间。

For more flexibility, use the --where option. 要获得更大的灵活性,请使用--where选项。 That would allow you to write, for example --where test=~ME_NTJ_INCLUDE for a partial match of the name. 这样一来,您就可以编写--where test=~ME_NTJ_INCLUDE来部分匹配名称。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM