Clone Repository
git clone https://github.com/sadabnepal/playwright-e2e-test-automation.git &&
cd playwright-e2e-test-automationInstall Packages
npm install
npm run prepareInstall Browsers
npx playwright install --with-deps chromium
npx playwright install --with-deps webkitRun tests and Generate Report
npm test [ run all tests ]
npm run test:chromium [ Run UI tests in Chromium ]
npm run test:webkit [ Run UI tests in Webkit ]
npm run test:api:rest [ Run API tests ]
npm run test:api:graphql [ Run API tests ]
npm run test:ios [ Run ios mobile tests ]
npm run test:android [ Run android mobile tests ]Code Analyze and Fix
npm run lint
npm run lint:fixcheck script section of package.json for more test commands
- Support for: Web App, Rest API, GraphQL
- Report: Playwright HTML, Ortoni HTML
- CI/CD: Github Action
- Schema validation: zod library
- Test data generator: faker-js library
- Multi environment and secretes: dotenv library
- Code Quality Control: EsLint, Husky, Custom Interface
run following command to check what of playwright is used by mobilewright
cat node_modules/@mobilewright/test/node_modules/@playwright/test/package.json | grep '"version"'
in package.json below section update the same version
"overrides": {
"@playwright/test": "1.58.2"
}
clean install
rm -rf node_modules package-lock.json
npm install
verify only one copy exists
find node_modules -name "package.json" -path "*/@playwright/test/package.json" | xargs grep '"version"'
chmod +x remove-mobile.sh
./remove-mobile.sh
