I have a C#/Selenium/Specflow test suite which I am running using Jenkins using xunit.console.exe. I need to point these tests to different environments (Test/QA/Prod etc.) and would like to use a command line parameter.
The batch command I am calling is:
"%WORKSPACE%\packages\xunit.runner.console.2.1.0\tools\xunit.console"
"%WORKSPACE%\[MyProject]\bin\Debug\eDC6.Test.Specs.dll" -xml test_output.xml
and would like to include an extra parameter like: "-env=PROD" to point that job to a specific environment.
I am open to better ways to do this.
xunit.runner.visualstudio. This package contains the VSTest runner. This runner is capable of running . NET Framework projects from xUnit.net v1 and v2, and . NET Core and UWP projects projects from xUnit.net v2.
xunit. runner. json (where <AssemblyName> is the name of your unit test assembly, without the file extension like . dll or .exe ). You should only need to use this longer name format if your unit tests DLLs will all be placed into the same output folder, and you need to disambiguate the various configuration files.
For this solution the extra command-line gives me more flexibility:
"%WORKSPACE%\packages\xunit.runner.console.2.1.0\tools\xunit.console" "%WORKSPACE%[MyProject]\bin\Debug\eDC6.Test.Specs.dll" -TargEnv QAConfig.json - xml test_output.xml
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With