小编典典

从Nunit3-console.exe运行个别测试

selenium

当我跑步

nunit3-console.exe (myfilepath)\dll file

Console Runner运行我所有的测试。

我需要运行什么命令才能运行各个测试?我试过了

nunit3-console.exe  /run:namespace.class.method (myfilepath)\dll file

它表示我使用的参数无效。有人可以为我提供正确的语法吗?

谢谢


阅读 368

收藏
2020-06-26

共1个答案

小编典典

您想查看--where命令行选项,以运行单个测试或过滤测试。它是NUnit
3的新增功能。该--where选项使用测试选择语言,有点像SQL进行测试。

nunit-console --where "method =~ /Source.*Test/ && class =~ 'My.Namespace.Classname'" test.dll

对于简单的过滤器,您还可以将该--test=NAMES选项与简单的测试名称列表(以逗号分隔)一起使用。

nunit3-console.exe --test=namespace.class.method test.dll

对于TestCase其他数据驱动的测试,可能难以确定各个测试的测试名称。在这种情况下,您可以使用该--explore选项。

2020-06-26