How to execute NUnit test cases from command prompt

前端 未结 6 1574
难免孤独
难免孤独 2021-02-07 00:30

How can I execute a test case from Command Console using NUnit? I had set of Selenium Tests written in C# based on NUnit framework. I need to execute the test cases simply by ru

6条回答
  •  Happy的楠姐
    2021-02-07 00:51

    • Working on a Windows 10 Desktop with Visual Studio
    • I had a set of tests in C# where I'd set the test method with Category==API.
    • To run the tests (Nunit3-console) remotely via Bamboo, I added this Bamboo Powershell script:

      Invoke-Command -Credential $credentials -ComputerName $Server -ScriptBlock{
           $pathToDdrive = "D:"
           $pathtoDLL = Join-Path $pathToDdrive -ChildPath "RestOfThePathToDLL"
      
           cd D:\...\NUnit.ConsoleRunner.3.10.0\tools
           .\nunit3-console.exe $pathToDLL --where "cat=='API'" 
      } 
      

提交回复
热议问题