This repository contains a demo project that automates both UI and API testing for the "Rest API Test Site" using Playwright and TypeScript. The project is structured to handle testing scenarios and serves as a guide for integrating UI and API tests within a single framework.
-
UI Testing:
- Automates user interactions on the Rest API Test Site.
- Validates key elements like buttons, forms, and navigation flows.
- Ensures visibility and functionality of critical UI components.
-
API Testing:
- Validates REST API endpoints for correct responses and data.
- Tests different authentication types (e.g., Basic Auth, Bearer Token).
- Handles scenarios like error responses, missing headers, and invalid requests.
- Node.js (>= 16.x)
- npm or yarn
- Git
-
Clone this repository:
-
Install dependencies:
npm install
-
Install Playwright browsers:
npx playwright install
npx playwright test
npx playwright test tests/ui
npx playwright test tests/api
npx playwright test tests/api/comments.spec.ts
Happy Testing!