Skip to content

Automated tests

Edwin van Wijk edited this page Apr 12, 2026 · 5 revisions

The Pitstop solution contains 2 types of tests: unit-tests and UI tests.

Unit-tests
Unit-tests projects exist for the WorkshopManagementAPI (core domain), Notification service and Invoice service. You can run the tests by executing the following steps:

  • Open a command-prompt.
  • Change the current-folder to the src/[Service].UnitTests folder within the repo.
  • Execute the following command: dotnet test.

The unit-tests use test-data builders to generate random data for the tests. These builders use generic random value generators in the TestUtils project.

UI Tests
The UI tests are situated in the UITest project. This project contains some tests that test the following functionality: all the menu-buttons in the UI, adding a customer, adding a vehicle, adding a maintenance-job and finishing a maintenance-job. It does this by automating the browser using Playwright. These tests are mainly used for integration-/regression-testing.

⚠️ CAUTION!
The UITest clears all data from the databases before it starts. This is to make sure there is a consistent starting point for the test. If you have data in the databases you want to keep, backup this before running the UITests.

You can run the tests by executing the following steps:

  • Start the application as described above.
  • Open a command-prompt.
  • Change the current-folder to the src/UITest folder within the repo.
  • Execute the following command: dotnet test.

A browser-window will be opened and automated by the Selenium web-driver. By default, the MS Edge browser is used. But you can change this by changing the Channel property of the BrowserTypeLaunchOptions used in the file PitstopApp.cs. See the Playwright documentation for the supported values. When integrating this into a CI pipeline, you can also use the headless mode supported by Playwright (also a BrowserTypeLaunchOptions property).

Clone this wiki locally