【发布时间】:2021-02-25 11:02:37
【问题描述】:
我的一个项目使用规范流 + MSTest + MSBuildGeneration 工具。我在我的 srsprofile 中定义了几个过滤器标签,并创建了一个类似下面的运行设置文件
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<!-- Configurations that affect the Test Framework -->
<RunConfiguration>
<!-- Path relative to solution directory -->
<!--<ResultsDirectory>..\..\..\Reports\LastRun\</ResultsDirectory>-->
<!-- [x86] | x64
- You can also change it from menu Test, Test Settings, Default Processor Architecture -->
<TargetPlatform>x86</TargetPlatform>
<!-- Framework35 | [Framework40] | Framework45 -->
<TargetFrameworkVersion>Framework46</TargetFrameworkVersion>
</RunConfiguration>
<!-- test adapter -->
<MsTest>
<Profile>sample.srprofile</Profile>
</MsTest>
</RunSettings>
UnitTest 提供者
<specFlow>
<stepAssemblies>
<stepAssembly assembly="MyProject.Steps" />
</stepAssemblies>
<unitTestProvider name="MsTest" />
<!-- For additional details on SpecFlow configuration options see http://go.specflow.org/doc-config -->
</specFlow>
由于我使用的是 MSTest 而不是 SpecRun,因此我认为适配器应该是 MsTest,但是对于定义的过滤器,测试没有显示在 Visual Studio 2017 的测试资源管理器中。我做错了吗?在 srsprofile 中为 mstest 使用过滤器标签是否有不同的方法?
【问题讨论】:
-
specFlow 测试是完全显示,还是现在才显示在指定的过滤器下?
-
SpecFlow 测试显示没有任何测试设置或运行设置。但我不想一次运行所有过滤器标签,我想控制它,我相信这将通过 runsettings 文件来完成,您在其中提供定义过滤器的 srprofile 路径,但我只是不知道一种与 MsTest 一起使用的方法
标签: c# visual-studio mstest specflow runsettings