I'm starting to learn Playwright. It is a promising test automation tool. The great thing is that you can use many programming languages to use PlayWright. The languages supported by the Playwright are given below:
- JavaScript
- Java
- C#
- Python
PlayWright also provides excellent tools for debugging tests in real-time. You can also produce test run recordings and logs with detailed screenshots. Other than UI testing, you can also test APIs with Playwright.
$env:PWDEBUG=1
$env:PWDEBUG=0
.\playwright.ps1 show-trace
$env:HEADED="1"
$env:HEADED="0"
dotnet test --settings:chromium.runsettings
Running on Ubuntu VMs is headless mode, which is supported by default. To run non-headless mode, you must set up X GUI. Extra frills!
.\bin\debug\net6.0\playwright.ps1 codegen google.com
.\bin\Debug\net6.0\playwright show-trace .\bin\Debug\net6.0\playwright-traces\PlaywrightTest01.PlaywrightAutomation01.OpenGoogleAndSearchTest.zip
--save-storage
With npx playwright codegen allows you to preserve authenticated state by saving cookies and localStorage. Super handy for recording tests with common authentication steps!
$env:DEBUG="pw:api"