Skip to content

Zarboni/api-testing-portfolio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API Testing Portfolio — Playwright + JSONPlaceholder

A professional API testing project demonstrating backend QA skills using Playwright's built-in API testing capabilities. Covers all five core HTTP methods with positive, negative, and edge case test scenarios — fully automated via GitHub Actions CI/CD.


Test Run Evidence

API Tests Passing

What This Project Demonstrates

Skill How It's Shown
API test automation Playwright request context — no browser needed
HTTP method coverage GET, POST, PUT, PATCH, DELETE
Test type coverage Positive, Negative, Edge Case, Schema validation
Status code validation Every test asserts the correct HTTP status code
Response body validation Field values and data types are checked
Schema validation Verifying field names and data types on response objects
Negative testing Non-existent IDs, empty payloads, boundary values
CI/CD GitHub Actions runs tests automatically on every push
Documentation Test cases, bug reports, and API examples in /docs

Tech Stack


API Under Test

JSONPlaceholder (https://jsonplaceholder.typicode.com) is a free, reliable, public REST API used widely for testing and prototyping. It provides standard CRUD endpoints with no authentication required — making it ideal for portfolio and demo projects.

Resources tested: /posts, /posts/:id, /posts/:id/comments


Test Coverage Summary

File HTTP Method Tests What's Covered
tests/get.spec.js GET 16 List all, fetch one, nested resources, 404 cases, schema
tests/post.spec.js POST 8 Create, field validation, edge inputs
tests/put.spec.js PUT 6 Full update, response validation, non-existent ID
tests/patch.spec.js PATCH 7 Partial update, field preservation, non-existent ID
tests/delete.spec.js DELETE 7 Delete, empty response body, invalid IDs
Total 44

Project Structure

api-testing-portfolio/
├── .github/
│   └── workflows/
│       └── api-tests.yml       # GitHub Actions CI pipeline
├── tests/
│   ├── get.spec.js             # GET tests — fetch all, single, nested
│   ├── post.spec.js            # POST tests — create resource
│   ├── put.spec.js             # PUT tests — full update
│   ├── patch.spec.js           # PATCH tests — partial update
│   └── delete.spec.js          # DELETE tests — remove resource
├── docs/
│   ├── api-test-cases.md       # Complete test case table (all 43 cases)
│   ├── sample-bug-reports.md   # Example bug reports written as a QA Engineer would
│   └── example-requests-responses.md  # Real API request/response examples + curl commands
├── playwright.config.js        # Playwright configuration
├── package.json
└── README.md

Running Tests Locally

Prerequisites

  • Node.js v18 or later
  • npm

1. Clone and install

git clone https://github.com/YOUR_USERNAME/api-testing-portfolio.git
cd api-testing-portfolio
npm install
npx playwright install chromium

2. Run all tests

npm test

3. Run with verbose output (recommended while learning)

npm run test:list

4. Open the HTML test report

npm run report

The HTML report opens in your browser and shows a full breakdown of every test — passed, failed, and the response data for each request.


CI/CD

Every push to main automatically triggers the test suite via GitHub Actions.

Pipeline steps:

  1. Check out code
  2. Set up Node.js 20
  3. Install npm dependencies
  4. Install Playwright
  5. Run all API tests
  6. Upload HTML report as a build artifact (retained for 14 days)

See the full workflow: .github/workflows/api-tests.yml


Documentation

File Contents
docs/api-test-cases.md Full test case table with IDs, types, and expected results
docs/sample-bug-reports.md Four realistic bug reports in professional QA format
docs/example-requests-responses.md Raw request/response examples and curl commands

Related Projects

About

API testing portfolio using Playwright, JavaScript, automated API tests, documentation, and GitHub Actions.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors