- Introduction
- Prerequisites
- Getting Started
- Running Tests
- Project Structure
- Configuration
- Continuous Integration
- Reporting
- Other Projects
- Technical Documents
- Contacts
This repository contains a Test Automation Framework built using Playwright and Javascript for automated testing of REST APIs.
-
Clone the repository:
git clone https://github.com/rajatt95/TestAutomationFramework_YT_Rajat_API_Playwright_JS.git
-
Navigate to the project directory:
cd TestAutomationFramework_YT_Rajat_API_Playwright_JS -
Install dependencies:
npm install
npm run playwright:testsThe tests follow a modular and maintainable structure:
|-- .github
| |-- workflows
| |-- 01_api_tests.yml
| |-- 02_api_tests_select_env.yml
|-- test-data
| |-- login
| |-- login-successful.json
| |-- login-unsuccessful.json
| |-- register
| |-- register-successful.json
| |-- register-unsuccessful.json
| |-- users
| |-- user_create.json
| |-- user_update_patch.json
| |-- user_update_put.json
|-- tests-reqres
| |-- login.spec.js
| |-- register.spec.js
| |-- users.spec.js
|-- utils
| |-- EndpointUtils.js
| |-- RequestBodyUtils.js
| |-- RequestUtils.js
| |-- ResponseUtils.js
| |-- VerificationUtils.js
|-- .gitignore
|-- package.json
|-- playwright.config.js
playwright-report: Contains the HTML report for tests (Logs are attached).test-data: Contains external files (example: user create/update data) that can be used to mock data during tests.tests-reqres: Contains the actual test files. You can organize your tests into subdirectories as needed.utils: Contains the Utilities that provides methods for asserting different conditions on web elements, handling requests and responses.
- Modify
playwright.config.jsfor playwright configuration settings such asbaseURLtestDirreporter
This project is configured for CI using Github Actions. Check the configurations in .github/workflows/*.yml.
01_api_tests.yml: This workflow executes tests in pre-defined environment PROD.02_api_tests_select_env.yml: This workflow will first ask User to select the environment (DEV / Pre-PROD / PROD) for tests execution.
Playwright HTML report (Logs are attached) is stored in the playwright-report directory.
Feel free to reach out if you have any questions, or suggestions, or just want to chat!
Thanks for visiting my GitHub profile! π