How do I install NUnit 3 console on Windows and run tests?

后端 未结 4 388
不思量自难忘°
不思量自难忘° 2021-02-02 08:57

I want to run tests from a console like this (being in any directory, the DLL file can be for a different .NET version):

$ nunit3-console test.dll
4条回答
  •  借酒劲吻你
    2021-02-02 09:03

    I am using NUnit3-console.exe with Selenium WebDriver to run my automation, all of which is written in C#. I have multiple environments set up under discreet logins of Windows Server 2012.

    NUnit-Console doesn't have to be "installed", although the .msi is readily available. Instead, I use the .zip and extract the files to a directory, C:\Nunit, rather than allowing the invocation to resolve from the PATH. All invocations are from a Windows Forms scheduler in the form -

    C:\Nunit\NUnit3-Console.exe -work:C:\Users\xxxx\Automation\TestResults\ -out:TestResult.xml --where "name =~ 'yyyy'" --p environment=qa;browser=Firefox;browserSizeX=1200;browserSizeY=800 "C:\QA_Libraries3\zzzz.dll"
    

    The test parameters are passed on the command line and the NUnit results plus results from the test are extracted from the TestResult.xml which is distinct for each user (environment).

提交回复
热议问题