This project is to spike and investigate features of Playwright. Currently attempting the following:
- POM
- API requests
- Configuration options
- Allure Report - S3 and GH Page storage
- Lighthouse - Skipped not working after an update
- Visual Regression
- Sharding in GitHub
- TypeScript as the programming language
- Playwright for browser automation
- Playwright Test as the core test framework
- Chromium as the local browser for testing
- npm for dependency management
Additionally, we are using the following:
- dotenv for environment management
- Biome for statically analyzes code for issues and for automatically formatting code
- Falso for providing fake data
- xml2js for XML to JavaScript object converter
-
Clone the repo using SSH
-
Navigate to folder and install npm packages using:
npm install
npx playwright install
- Visual Studio Code
- Node.js use recent version (>16)
- typescript
- npm-check-updates
The following will be consider essential but you can use optional tools:
- Playwright Test for VSCode
- Playwright Trace Viewer for VSCode
- Biome for statically analyzes code for issues and for automatically formatting code
Optional
- Ensure all prerequisites are installed as outlined above.
You will need to create a .env file at the root folder which will configure your local settings, this will NOT be in source control. See .env File Creation
In all of the following cases, there will multiple options and ways to perform these actions but this is a cut down CLI version. Review the Wiki for alternatives. You will be running these commands via a VsCode terminal.
Build
npm run build
Linter
npm run lint
There are several ways to run tests and most configuration options will found in the Wiki, for more advanced options consult Playwright
All Tests
npm run test
Unit Test Only
npm run test --project=unit
Functional Test Only
npm run test --project=functional
E2e Test Only with Chromium
npm run test --project=chromium