Skip to content

Repository files navigation

Playwright TypeScript Test Automation Framework

Requirements:

NodeJs VSCode

Getting Started:

Clone Repository

git clone https://github.com/sadabnepal/playwright-e2e-test-automation.git &&
cd playwright-e2e-test-automation

Install Packages

npm install
npm run prepare

Install Browsers

npx playwright install --with-deps chromium
npx playwright install --with-deps webkit

Run 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:fix

check script section of package.json for more test commands

Features:

- 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

Tech stacks:

Playwright GraphQL TypeScript GithubActions ESlint Husky zod

Sample Report:

Report

version conflict with mobilewright (playwright under the hood)

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"'

remove mobile setup if not required for the project

chmod +x remove-mobile.sh
./remove-mobile.sh

About

Scalable Playwright e2e automation framework for UI and API testing with modern test design and best practices.

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages