This project is a Playwright-based testing framework for UI application(s). The framework is designed to automate APIs, end-to-end & Regression testing, ensuring the application functions correctly across different browsers, APIs and devices.
Follow these steps to get the code up and running on your system.
Ensure you have the following installed on your system:
- Node.js (version 20 or higher)
- npm (comes with Node.js)
- Playwright
-
Clone the repository:
git clone https://github.com/kishkk84/Playwright-TypeScript.git cd Playwright-TypeScript -
Install the dependencies:
npm install -
Install Playwright browsers:
npx playwright install npx playwright install-deps -
Install the below extensions from visual studio code extensions.
Playwright Test for VSCode Prettier - Code formatter open in browser
Create a .env.local file in the env directory with the necessary environment variables.
From the root of the project run the below command
npm run test:reg
npx playwright test path/to/test-file.spec.ts
npx playwright show-report
- .git: Contains hooks
- .pipelines: Contains pipeline configuration files for CI/CD.
- authentication: Stores authentication-related files.
- env: Contains environment-specific configuration files.
- fixtures: Contains fixture files for setting up & tearing down the test & data.
- pages: Contains page object files for the application(s).
- playwright: Contains global setup and global teardown scripts for Playwright.
- reports: Stores all test reports like allure, html, json etc.
- tests: Contains api & ui test files.
- utils: Contains utility functions and helpers.