Skip to content

yosuancrespo/qa-api-playwright-bdd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API Test Automation – Playwright + BDD

Overview

This project implements an automated API test scenario using Playwright and BDD. It validates a user and order workflow against two mock services running in Docker containers on a Linux environment.

Scenario Covered

  1. Retrieve an existing user (id = 1)
  2. Retrieve active orders for the user
  3. Create a new order for the user
  4. Validate HTTP responses and response contracts

Tech Stack

  • Node.js
  • TypeScript
  • Express (mock services)
  • Playwright (API testing)
  • BDD-style tests using Playwright (Given/When/Then semantics)
  • Docker & Docker Compose

Project Structure

  • services/
    • user-service/ # Mock user API
    • order-service/ # Mock order API
  • tests/
    • user-orders.spec.ts # API test (BDD-style)
    • validators/ # Interface-based validators
    • playwright.config.ts

How to Run

1. Start mock services

Run from the project root:

docker compose up

Leave the containers running.

2. Run automated tests

In another terminal, from the project root:

npm test

User Service: http://localhost:3001

Order Service: http://localhost:3002

Note on BDD

This project demonstrates BDD-style step definitions using Given/When/Then to clearly express test intent. The BDD approach is implemented using Given/When/Then semantics within Playwright tests. The focus is on test structure, assertions and contract validation rather than feature file execution.

About

Playwright API automation framework built with TypeScript, Docker and BDD. Demonstrates containerized test architecture, microservices mocking, contract validation, CI-friendly execution and living documentation.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors