For detailed documentation of Playwright and its related API references go here https://playwright.dev/docs/intro
The sample application under test is https://cash-conversion.dev-tester.com/
This repo contains all the basic setup required to get started with Playwright for UI e2e automation. The tests are written in Typescript
and project has the below files and folders defined so that a developer can start writing tests right away.
tests
- All of the e2e tests goes hereactions
- The place to define the test components or user actions using the page-object pattern.ui.actions
file should contain all the ui interactions and theapi.actions
file should contain all the api actions needed for testsnetwork
- The place to define all the api mocks or the api loggersutils/config.ts
- To support different configs for running tests in different evironmentsplaywright.config.ts
- Contains all the basic configurations for Playwright including report generation, tracing etc.github/workflows/main.yml
- Giuthub Actions to run the tests over CItests/lighthousePerformance.spec.ts
- Sample front-end performance test using Google Lighthouse
- Install node
https://nodejs.org/en/
- Install yarn
https://classic.yarnpkg.com/en/docs/install
- Run yarn to install the node packages
yarn
To run the test on the default chromium browser run
yarn e2e
To run the tests on headed mode run
yarn headed
To run the tests on debug mode run
yarn debug
To run in all browsers simultaneously run
yarn playwright test --browser=all
To view the test reports after the execution with the html reporter run:
yarn reports
For every commit tests will be run over the CI using Gitlab Actions.