Skip to content

Automated API test framework using Playwright and JavaScript to validate Reqres API endpoints. Covers full CRUD operations, login flows, schema checks, and CI integration with GitHub Actions and HTML reporting for clean test visibility.

Notifications You must be signed in to change notification settings

anandavii/user-api-tests-playwright

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

User API Test Automation with Playwright

Playwright Node.js version Build Status Last commit

Overview

This is a Playwright-based API Test Automation Framework built using JavaScript. It is designed to validate REST API endpoints from the Reqres.in API, covering full CRUD operations and authentication workflows. The project demonstrates how to perform API testing using Playwright's request context and is suitable for both learning and showcasing in portfolios.

Goals of this Framework

  • Automate key API workflows using Playwright’s request fixture
  • Validate HTTP methods: GET, POST, PUT, DELETE
  • Cover positive and negative test validations
  • Ensure readable, reusable and scalable test code
  • Prepare a CI-ready, beginner-friendly automation project

What’s Implemented So Far

  • GET Requests
    Validates user detail retrieval with status and field-level checks

  • POST Requests

    • Create new user
    • Successful login
    • Failed login (missing password)
    • Successful registration
  • PUT Requests

    • Update user name and job, validate response and timestamp
  • DELETE Requests

    • Delete user and assert status code 204 (No Content)

Usage

  1. Install dependencies
    npm install

  2. Run all tests
    npx playwright test

  3. View the HTML report
    npx playwright show-report

Project Details

  • Framework: Playwright (JavaScript)
  • Test Type: API Testing (using request context)
  • Base API: https://reqres.in
  • Language: JavaScript (CommonJS)
  • Runner: Playwright Test
  • Reporting: Built-in HTML Reporter

Next Steps

  • Introduce reusable API utility functions for cleaner code
  • Add .env support for managing base URLs and tokens
  • Integrate GitHub Actions for CI-based test execution
  • Explore Allure Reporting for advanced test reports

About

Automated API test framework using Playwright and JavaScript to validate Reqres API endpoints. Covers full CRUD operations, login flows, schema checks, and CI integration with GitHub Actions and HTML reporting for clean test visibility.

Topics

Resources

Stars

Watchers

Forks