Rest API and Selenium 4 projects on .CORE 3.1
- IDE (integrated development environment) to work with the C# e.g. Visual Studio
- Pull git solution
- Build solution from IDE (e.g. in Visual Studio) or run the following command in command line: "dotnet build"
##How to run tests
-
In VIsual studio, Open root of the project tests you want to run, e.g. "JsonPlaceholder.Api.Tests" for API tests
-
Select .runsettings file you want to run with, on top navigation menu -> "Test" -> "Configure Run Settings" --> Select file from the project root
-
Open Test Explorer window, on top navigation menu -> "Test" -> "Test Explorer"
-
Choice test you want to run or all tests scope
-
Right button context menu and click run
- Open RestApiTestsOnDotNetCore3_1 test project root folder
- Open CMD for this folder (or shell command line in Linux)
- Type "dotnet test -s "./env.runsettings"", where -s is a location of .runsettings test configuration file
- Report generation requires local Docker installation https://docs.docker.com/get-docker/
- Test it typing "docker --version" to command line
- On Windows OS --> Find powershell script in the root of the any test projects "GenerateAllureResultsAndOpenInDockerContainer.ps1"
- Run this script in powershell
Note: Results will be opened in Docker attached mode. It means, container will be stopped once you close PowerShell window. In order to run it in dettach mode, please open Powershell and change last line "docker-compose up" to "docker-compose up -d"