/*
 This is a C# project that uses NUnit, Playwright to create simple API, E2E, and UI tests.

Requirements
[.NET 8.0] 
[Visual Studio] or [Visual Studio Code] with [C# extension]
[NUnit 3 Test Adapter] extension for Visual Studio
[Microsoft Playwright CLI] for installing browsers

**Installation**

1. Clone this repository or download the zip file. 
1. Open the solution file in Visual Studio or the folder in Visual Studio Code.
1. Restore the NuGet packages by running dotnet restore in the terminal.
1. Install the browsers by running playwright install in the terminal.
1. Running the tests.
1. To run all the tests, use the Test Explorer in Visual Studio or run dotnet test in the terminal.
1. To run a specific test, use the [Category] attribute with the desired parameters.
1. Writing the tests.
1. The tests are organized into three folders: API, E2E, and UI.
1. The API tests use HttpClient and HttpResponseMessage to make requests and verify responses.
1. The E2E tests use API for preconditions and Playwright and Page to interact with web elements and navigate through pages.
1. The UI tests use PlaywrightSharp and Page to verify the appearance and behavior of web elements The assertions are made using FluentAssertions and its fluent syntax.

 
 Before run any UI test, please install Playwright:       
  1) Powershell 
  winget search Microsoft.PowerShell
  winget install --id Microsoft.PowerShell --source winget
  winget install --id Microsoft.PowerShell.Preview --source winget

  2) Please run the following command to download new browsers: 
     cd IWS5.Autotest -> dotnet add package Microsoft.Playwright.NUnit  
     Then pwsh bin/Debug/net8.0/playwright.ps1 install
     If pwsh is not available, you will have to install PowerShell.
     pwsh IWS5.Autotest/bin/Debug/netX/playwright.ps1 install          
  3) Build 
 */