2

我目前在 30 多个项目上运行了大约 6000 多个测试。

其中一些测试只能在本地运行,因此已使用以下属性进行修饰:

TestCategory="Manual Tests" 

这也适用于任何功能测试,它们装饰有:

TestCategory="Functional Tests" etc...

我已经阅读了许多关于此的 MSDN 和用户文章,并设置了一个构建以仅运行功能测试

Test Case Filter: TestCategory=Functional Tests 
(This successfully runs only the Functional Tests)

问题是,是否有一个我可以使用的测试用例过滤器将忽略 TestCategory“功能测试”和“手动测试”,并且只运行没有用 TestCategory 属性修饰的测试。

如果使用了以下过滤器案例没有乐趣:

**Test Case Filter:**

!Functional Tests|!Manual Tests
TestCategory!=Functional Tests|Manual Tests
TestCategory!=Functional Tests|!Manual Tests
TestCategory!=Functional Tests|TestCategory=Manual Tests
TestCategory!=Functional Tests||TestCategory=Manual Tests
(TestCategory!=Functional Tests)|(TestCategory=Manual Tests)
(TestCategory!=Functional Tests)||(TestCategory=Manual Tests)

我在带有 TFS 2012(更新 4)的 Visual Studio 2012(更新 4)上运行它

非常感谢

4

2 回答 2

1

通过在过滤器周围使用“()”来解决问题。还有 | is or, and & is and so 使用 x!=y 或 y!=z 将不起作用。使用 & 表示不等于评估。

/TestCaseFilter:"(TestCategory!=PreTest&TestCategory!=PostTest&TestCategory!=CleanUp)"

于 2015-09-03T17:21:02.437 回答
0

从小处着手,然后建立..您是否刚刚尝试过一种说法,例如:TestCategory!='Functional Tests'

查看文档,我对完整命令的第一个选择是:TestCategory!='Functional Tests'&TestCategory!='Manual Tests'

于 2015-01-31T16:09:39.603 回答