Skip to content

Latest commit

 

History

History
22 lines (16 loc) · 1.74 KB

ExecutingTests.md

File metadata and controls

22 lines (16 loc) · 1.74 KB

Executing tests

Executing tests from Visual Studio

Executing tests from Visual Studio is as simple as running them from Test Explorer. Make sure that you follow the docs on creating test projects so the tests can show up.

Executing tests from the command line

In a CI environment you'd execute tests with the dotnet command line tool. These are the steps we recommend for CI builds:

  1. Build the solution with dotnet build in Release mode. We recommend using our .NET Analyzers for static code analysis and applying the code analysis switches on this step and during the dotnet publish ones later.
  2. Publish the web app's project with dotnet publish in Release mode, optionally also with ReadyToRun. Note that since the web app shouldn't really reference your UI test projects this doesn't publish those. Remove or don't publish the refs folder. That way, Razor Runtime Compilation will be switched off, which removes an unnecessary and slow step when executing UI tests.
  3. Publish the UI test project(s) with dotnet publish in Release mode.
  4. Run the UI tests with dotnet test. Note that by default, the app will run in the Development environment, which is what we need for testing.
  5. Optionally, if you want to reuse the build agent, kill the following processes that might remain after UI testing:
    • chromedriver.exe
    • dotnet.exe
    • geckodriver.exe
    • IEDriverServer.exe
    • msedgedriver.exe

Also see what to configure, especially for multi-agent build machines and tuning parallelization.