- This is skeleton work E2E Test automation project built using Playwright for .Net
- This also has skeleton work for the API testing using RestSharp
Note: Playwright does not support API testing on .Net with current version 1.22, known issue
- It required .Net core 3.1 installed
Once you have .Net Core 3.1 installed, and cloned the repo, follow the below instruction to run tests thru CLI:
-
Run
dotnet build
from the root of the repo -
Run
pwsh bin\Debug\netcoreapp3.1\playwright.ps1 install
- *NOTE: This command Installs required browsers - replace netcoreapp3.1 with actual output folder name, f.ex. net6.0.
- *If the pwsh command does not work (throws TypeNotFound), make sure to use an up-to-date version of PowerShell.
dotnet tool update --global PowerShell
- **If you don't have powershell installed on mac os, please refer this official page.
- Other link for the Reference
- Run
dotnet test
Hints:
To run BadExamples
test on Headed browser, run the following command:
- Please open the project
solution
file in VS - Once the project files and folder shows up, click on
Build
->Build All
- Now click on
View
->Tests
and it may display all the tests folder as below - Right click on the Test or folder and select
Run test
Hint: To run the BadExample tests on headed browser, run following command:
Window:
set HEADED=1
dotnet test --filter Name~Bad
Linux & Mac
HEADED=1 dotnet test --filter Name~Bad