Skip to content

quinncess18/taqelah-lab-project-test

Repository files navigation

Taqelah Boutique β€” Comprehensive Playwright Test Suite

Playwright TypeScript Docker GitHub Actions

End-to-end test automation suite for taqelah.sg β€” a modern fashion e-commerce platform. Demonstrates enterprise-grade testing practices with UI flows, mobile testing, visual regression, API CRUD operations, and advanced mocking patterns.


🎯 Project Highlights

βœ… 643+ automated tests across 8 focused test categories
βœ… Multi-browser coverage β€” Chromium, Firefox, WebKit
βœ… Mobile-first testing β€” iPhone 13, Pixel 5, tablet, widescreen viewports
βœ… Visual regression testing β€” Screenshot-based validation across devices
βœ… API testing β€” Real CRUD operations + network mocking patterns
βœ… CI/CD integration β€” GitHub Actions with 3-way parallel sharding
βœ… Production-ready patterns β€” Page Object Model, fixtures, global setup/teardown


πŸ“¦ Tech Stack

  • Framework: Playwright (TypeScript)
  • Testing: Jest/Playwright Test
  • Infrastructure: Docker (isolated API environment)
  • CI/CD: GitHub Actions
  • Code Quality: ESLint, TypeScript strict mode

πŸ—οΈ Project Architecture

Test Organization

Category Coverage Scope
Functional Auth, search, cart, checkout Desktop browsers (Chrome, Firefox, Safari)
Mobile Navigation, negative flows, E2E checkout iPhone 13, Pixel 5 β€” full mobile workflow
Smoke Critical-path login validation Cross-browser (Chromium, Firefox, WebKit)
Regression Full E2E happy path Chromium only β€” comprehensive flow validation
Visual Screenshot regression Desktop, mobile, tablet, widescreen β€” pixel-perfect
API Inventory Real CRUD operations Direct Docker API on port 8080 (isolated)
API Mocking Request interception patterns Network mock demos on separate port (isolated)
Advanced Patterns Stateful mocks, conditional responses Complex mock scenarios & request manipulation

Environment Isolation

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚          Live UI Tests (taqelah.sg)        β”‚
β”‚  Functional β€’ Mobile β€’ Smoke β€’ Regression  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  API Tests (Docker - Port 8080, Isolated)  β”‚
β”‚        Real CRUD β€’ No live DB connection   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Mocking Tests (Isolated Port, No Server)  β”‚
β”‚   Playwright.route() β€’ Network interceptionβ”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Getting Started

Prerequisites

  • Node.js 18+
  • Docker (required for api-local tests only)

Installation

# Clone and install dependencies
npm ci

# Install Playwright browsers and dependencies
npx playwright install --with-deps

Environment Setup

# For API local testing, ensure Docker is running
docker --version

# Verify Node.js version
node --version  # Should be 18+

πŸ“‹ Running Tests

All Tests

npm test

By Category

npm run test:smoke          # Quick smoke tests
npm run test:functional     # Functional flows
npm run test:regression     # Full E2E regression
npm run test:mobile         # Mobile-specific tests
npm run test:visual         # Visual regression tests

By Environment

# Real API (Docker required)
npx playwright test --project=api-local

# Mocked API (no server needed)
npx playwright test --project=api-mocking

Interactive & Debugging

npm run test:debug    # Playwright Inspector
npm run test:ui       # Playwright UI Mode (interactive)
npm run report        # View HTML test report

Visual Regression

# Run visual tests
npm run test:visual

# Update snapshots after intentional UI changes
npm run test:visual:update

πŸ›οΈ Design Patterns & Best Practices

Page Object Model (POM)

All UI tests follow the Page Object pattern for maintainability and reusability:

fixtures/               # Reusable test setup & pre-conditions

test-data/              # Hardcoded test data (no backend DB)
β”œβ”€β”€ checkout-scenarios.json
β”œβ”€β”€ products.csv
└── users.json

tests/
β”œβ”€β”€ pages/              # Page Objects (POM)
β”‚   β”œβ”€β”€ BasePage.ts
β”‚   β”œβ”€β”€ LoginPage.ts
β”‚   β”œβ”€β”€ ShopPage.ts
β”‚   β”œβ”€β”€ CartPage.ts
β”‚   └── index.ts
β”œβ”€β”€ api-inventory/      # Real API CRUD tests (Docker isolated)
β”œβ”€β”€ api-mocking/        # Network mocking patterns & request interception
β”œβ”€β”€ functional/         # UI flows (auth, search, cart, checkout)
β”œβ”€β”€ mobile/             # Mobile-specific tests (iPhone 13, Pixel 5)
β”œβ”€β”€ regression/         # Full E2E happy path validation
β”œβ”€β”€ smoke/              # Critical-path login checks
└── visual/             # Screenshot regression tests

API Testing Approaches

Real API: Direct calls to Docker-isolated REST API for genuine CRUD testing
Mocked API: Playwright page.route() for deterministic, backend-independent testing

Global Setup & Teardown

  • global-setup.ts: Runs once before all tests β€” launches browser, logs in as ladies user, saves authenticated session to .auth/taqelah-user.json
  • global-teardown.ts: Runs after all tests β€” preserves auth file for debugging (deletion commented out)
  • Test Usage: Tests load pre-authenticated state via test.use({ storageState: '.auth/taqelah-user.json' }) or via playwright.config.ts settings

Custom Fixtures

  • visual-fixture.ts β€” stablePage fixture: Auto-waits for networkidle, fonts, and all images before taking screenshots
  • worker-fixture.ts β€” uniqueEmail fixture: Generates worker-scoped unique email for each test execution

Test Data

  • test-data/users.json β€” Test user accounts with credentials, expected roles, and assigned promo codes
  • test-data/checkout-scenarios.json β€” Checkout flow test scenarios with hardcoded customer data
  • test-data/products.csv β€” Product search terms and expected results (parsed with csv-parse)

πŸ”„ CI/CD Pipeline

GitHub Actions workflow runs on every push and pull request:

  • βœ… 3-way sharding β€” tests distributed across 3 parallel jobs for speed
  • βœ… Cross-browser β€” Chromium, Firefox, WebKit in parallel
  • βœ… Artifact uploads β€” HTML reports, screenshots, videos (on failure)
  • ⏭️ API local tests excluded β€” require local Docker (manual testing)

Note: API tests run locally only; CI focuses on UI and mocking patterns.


πŸ“Š Test Metrics

Metric Count
Total Tests 50+
Test Files 13
Coverage Categories 8
Supported Browsers 3
Mobile Devices 2
Desktop Viewports 4

πŸ› οΈ Key Features

Robust Test Setup

  • Globally configured fixtures for reusable page contexts
  • Playwright config with retry logic and timeout management
  • Automatic screenshot/video capture on failures
  • Console log & network request monitoring

Advanced Mocking Patterns

  • Stateful mocks β€” simulate full CRUD with in-memory data
  • Conditional responses β€” validate request data and return context-aware responses
  • Request interception β€” capture, modify, and track API calls
  • Network simulation β€” test slow responses, failures, and edge cases

Mobile-First Testing

  • Responsive design validation across viewports
  • Touch interaction testing
  • Mobile-specific navigation flows
  • Device orientation handling

πŸ“š Learning Resources


🀝 Contributing

This is a portfolio project showcasing test automation best practices. For feedback or suggestions, feel free to reach out.


πŸŽ“ What I Learned

Building this comprehensive test suite reinforced key skills in:

  • Test Architecture β€” organizing tests by concern and criticality
  • Playwright Mastery β€” real API testing, mocking, and advanced patterns
  • CI/CD Integration β€” GitHub Actions parallelization and artifact management
  • Test Isolation β€” data cleanup, fixture management, environment separation
  • Problem Solving β€” debugging flaky tests, handling async operations, managing test state

πŸ™ Acknowledgments

Built on foundations from: Playwright Agentic AI workshop module

This framework originated from Playwright baseline workshop code and has been significantly expanded, refactored, and enhanced into a production-ready testing framework using Playwright and enterprise-grade best practices.

Special thanks to: Syam Sasi for creating the foundational workshop content and for championing this project with the testing community.


πŸ“ License

This project is licensed under the MIT License. See the LICENSE file for details.


Status: βœ… Project Complete β€” Ready for production-like workflows
Last Updated: April 2026

About

🎭 Comprehensive Playwright + TypeScript automation suite for Taqelah Boutique. Includes API CRUD/mocking, visual regression, and mobile emulation with CI sharding.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors