TestStack White - 运行 从命令行进行测试

TestStack White - Run tests from command line

我正在寻找从命令行开始测试的解决方案。

当我尝试像使用常规单元测试一样从 cmd 启动它时,它不起作用。
它说:

Starting execution...  
No tests to execute.

我在开始 'Run UI Tests' 阶段之前构建项目。

有什么让它发挥作用的想法吗?真的可以在 Whosebug、TestStack 的 github 问题或网络上的其他荣耀地方找到它

找到解决办法。 在我本地的开发机器上它正在工作,mstest 版本是 14 在构建代理机器上,mstest 版本是 15,它无法正常工作(它与 TestStack White 无关,只是单元测试没有工作)

我所做的是调用 vstest.console.exe 而不是 mstest.

C:\Program Files (x86)\Microsoft Visual Studio17\TestAgent\Common7\IDE\Extensions\TestPlatform\vstest.console.exe

所以,而不是

stage('Run UI Tests') {
    steps {
        bat('"C:\PATH_TO_MSTEST\mstest" /testcontainer:PATH_TO_MY_TEST_PROJECT\bin\Debug\MyTests.dll')
    }
}

我在 Jenkinsfile 中的命令是:

stage('Run UiTests') {
            steps {
                bat('"C:\Program Files (x86)\Microsoft Visual Studio\2017\TestAgent\Common7\IDE\Extensions\TestPlatform\vstest.console.exe" PATH_TO_MY_TEST_PROJECT\bin\Debug\MyTests.dll')
            }
        }

nunit3-console 是 MSTEST 的绝佳替代品。请参考下面link.

例如 nunit3-console \bin\Debug\Automation.dll --where "cat=Smoke-Tests"

https://github.com/nunit/docs/wiki/Console-Command-Line