Skip to content

B-8: Comprehensive E2E test suite with Playwright #203

@KuchiMercy

Description

@KuchiMercy

Summary

Playwright configuration exists in the backend test directory, but the E2E test suite is minimal. As the platform grows, comprehensive end-to-end tests are essential to prevent regressions on critical user flows.

Requirements

  • Write E2E tests covering the following critical flows:
    1. Wallet authentication: Challenge request, signature verification, JWT issuance, token refresh
    2. Escrow happy path: Create escrow -> invite parties -> fund -> release milestones -> complete
    3. Dispute flow: Create escrow -> fund -> file dispute -> admin resolves -> funds distributed
    4. Deadline expiration: Create escrow with deadline -> time passes -> auto-expire via scheduler
    5. Party acceptance: Invite party -> party accepts -> all parties accepted -> escrow activatable
    6. Admin operations: List users, list escrows, view audit logs, resolve disputes
    7. Error paths: Duplicate funding, unauthorized access, invalid state transitions, expired escrow operations
  • Mock the Stellar RPC and blockchain interactions for deterministic test execution
  • Set up test database fixtures with seed data
  • Target 80%+ coverage of API endpoints
  • Configure CI-compatible test execution (headless, parallel where possible)

Acceptance Criteria

  • All 7 test suites listed above pass consistently
  • Stellar RPC is mocked — no real network calls during tests
  • Test database is seeded and torn down per test suite
  • Tests can run in CI without manual intervention
  • No flaky tests (run 3x in CI to verify stability)
  • Test report shows endpoint coverage percentage
  • Tests complete in under 2 minutes total

Context

  • Playwright config: apps/backend/test/
  • Existing unit tests: Jest-based across modules
  • Backend entry: apps/backend/src/main.ts
  • Auth flow: apps/backend/src/modules/auth/auth.controller.ts

Rollout Phase

Phase 5 — Admin & Production Hardening

Points: 150 (Medium)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions