- Install new NUnit project:
dotnet new nunit -n PlaywrightTestsWithDotNet
- Navigate to project folder:
cd PlaywrightTestsWithDotNet
- Install Microsoft.Playwright.NUnit:
dotnet add package Microsoft.Playwright.NUnit
- Build project to assure every thing is OK:
dotnet build
- Install PowerShell
- Install Playwright browsers (verify which .net version is installed, ex: net8.0):
pwsh bin/Debug/net8.0/playwright.ps1 install
- Create a
project.runSettings
file on the root folder - Install codegen from Playwright:
npx playwright codegen
- In order to execute tests using the RunSettings:
dotnet test --settings:project.runsettings