Skip to content

Latest commit

 

History

History
82 lines (50 loc) · 1.53 KB

File metadata and controls

82 lines (50 loc) · 1.53 KB

Rest API Test Site - Playwright Project

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.


Project Features

  • 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.

Project Setup

Prerequisites

  • Node.js (>= 16.x)
  • npm or yarn
  • Git

Installation

  1. Clone this repository:

  2. Install dependencies:

    npm install
  3. Install Playwright browsers:

    npx playwright install

Running Tests

Running All Tests

npx playwright test

Running UI Tests Only

npx playwright test tests/ui

Running API Tests Only

npx playwright test tests/api

Running a Specific Test

npx playwright test tests/api/comments.spec.ts

Acknowledgments

Happy Testing!