Important
This repository is a mock/dummy project created strictly for portfolio demonstration and structural display purposes.
- Code Modification: The original production code, actual endpoint URLs, proprietary business logic, and sensitive environment data have been modified, stripped, or replaced with simulated variables.
- Framework Showcase: The primary intent of this repository is to demonstrate my ability to design an enterprise-grade automation testing architecture, handle stateful fixtures, implement JSON schema verification (AJV), and structure robust testing workflows using TypeScript and Playwright.
- Test Runner & HTTP Client: @playwright/test (^1.61.0)
- Data Contract Validation: Ajv JSON Schema Validator (^8.20.0)
- Mock Data Generation: @faker-js/faker (^10.5.0)
- Reporting System: Allure Playwright (^3.10.1)
- Stateful Test Fixtures: Utilizes custom Playwright fixtures (
src/fixtures) to isolate test contexts, automatically handle setup/teardown phases, and inject prerequisite data seamlessly. - Strict Schema & Contract Testing: Leverages
ajvand localized JSON schemas to instantly catch unexpected upstream API payload modifications or breaking changes.
The suite programmatically covers the complete CRUD cycle and logical business gates POS SaaS:
- Register & Verification: Validates tenant registration up to email verification handshakes.
- Login Credentials: Tests authentication tokens generation, expiration boundaries, and permission claims.
- An addon provides extra features or options to customize the main system or product for an additional cost.
- Management of retail customer profiles.
- Verifies full data isolation, assignment, and resource isolation configurations.
- Validates vendor data structures, procurement contacts, and tracking points for back-office inventory restocking.
- Ensures accuracy of metric configurations (e.g., kilograms, pieces, boxes) applied onto product inventory structures.
├── .github/workflows/ # Automated CI/CD execution pipeline (optional)
├── src/
│ ├── config/ # Environment and application parameters mapping
│ ├── data/ # Data input variations and structural test fields
│ ├── fixtures/ # Isolated test contextual dependencies hooks
│ ├── schemas/ # Expected static JSON contract definitions
│ └── utils/ # Schema validators (AJV wrapper) and text extensions
├── tests/
│ └── api-test/ # Main executable test specifications grouped by business flow
│ ├── flow_addon/ # CREATE, READ, UPDATE, DELETE suite for add-ons
│ ├── flow_auth/ # Auth operations (Register, Login, Email Verify)
│ ├── flow_customer/ # Customer management endpoints validations
│ ├── flow_outlet/ # Multi-outlet isolation integrity tests
│ ├── flow_supplier/ # Supplier registry business test suites
│ └── flow_unit/ # Measurement metrics payload tests
├── playwright.config.ts # Global framework settings and report routing
├── package.json # Project identity and strict dependency locks
├── tsconfig.json # TypeScript compilation compiler instructions
└── .env.example # environtment example
Clone the repository and fetch the verified node module suites:
npm installCreate a .env file at the root directory of the project:
API_BASE_URL=https://staging-pos-saas.comRun the automated test pipelines using the following triggers:
# Execute all API test specification files
npx playwright test
# Execute a specific business flow (e.g., Authentication)
npx playwright test tests/api-test/flow_auth/To review rich execution logs, historical data, and clear graphical visualizations:
# Generate Allure results
npx playwright test
# Open the Allure Report server locally
npx allure serve allure-results