- Install nodejs: https://nodejs.org
- Install project:
- Clone from bitbucket
- Access to Project
- Install packages:
npm i
npx playwright install chromium --with-deps- Build image
docker build -t playwright-ui .- Create container
docker run -t -d --name playwright-ui-cont playwright-ui- How to config playwright project: here
- How to config test environment on local machine: here
- How to config and run formatter: here
- How to config display monitors on local for debuggung: here
- How to config bitbucket local runners: here
- Custom tools:
- CICD:
- How to use bitbucket pipeline and slack reporter: here
-
src: contains all of corebase, page object models, fixtures, supporting tools
-
tests: contains all of testcase
-
data: tests data
-
configs: configs files for environment
-
playwright-report: contains html/json report file
-
husky: contains precommit trigger
-
logs: logger output file
-
resources: resource files like docs, media,...
The role and using of each part will be detailed in its own readme.
- Run all test
npx playwright test- Run only project by name
npx playwright test --project project-name- Run with browser
npx playwright test --headed- Run with trace viewer
npx playwright test --ui- Run with container ("playwright-ui-cont") and project name("wp"/"delivery")
docker exec -it playwright-ui-cont bash -c "npx playwright
test --project delivery"Stored in .env file or go with command line
- ENV: choose the test environment. Option: int, dev. Only use with test command line. Eg:
ENV=int npx playwright test --project delivery- HEADLESS: run on headless mode. HEADLESS=1 is requied for cloud environments. Only use with env file.
- CI: marks the test being run on the CI flow. CI=1 is requied for cloud environments. Only use with env file.
- WORKERS: number of parallel workers can run at a time. Varies based on machine configuration. Only use with env file.
- SCREENSIZE: size of browser window. Only use with env file.
- CAPTURE: store capture and stored in report or not. Only use with env file.