TestStack White - Run tests from command line TestStack White - Run tests from command line jenkins jenkins

TestStack White - Run tests from command line


Found a solution. On my local developer machine it was working, the mstest version was 14 On the build agent machine the mstest version was 15, that was not working somehow (it had nothing to do with TestStack White, simply the unit tests were not working)

What I do is, calling vstest.console.exe instead of the mstest.

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

So, instead of

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

My command in the Jenkinsfile was:

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 is great alternative to MSTEST. Please refer below link.

e.g.nunit3-console \bin\Debug\Automation.dll --where "cat=Smoke-Tests"

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