Skip to content

[Testing] Setup Playwright E2E Framework for UI and Integration Validation #96

Description

@BeSovereign

Summary

Initialize a robust E2E testing framework using Playwright to validate the Freeshard UI and the orchestration of third-party apps. This setup must be suitable for both local development and CI/CD pipelines.

Technical Context

  • Base Directory: Create a new top-level directory tests/e2e/ in the freeshard repository.
  • Language: TypeScript.
  • Framework: Playwright Test (@playwright/test).

Implementation Details for the Agent

  1. Dependency Setup:
    • Create tests/e2e/package.json with @playwright/test and typescript.
    • Add scripts: test:e2e, test:e2e:ui, test:e2e:debug.
  2. Configuration (playwright.config.ts):
    • Base URL should be configurable via PORTAL_DOMAIN env (default to http://localhost).
    • Setup projects for Chromium, Firefox, and Webkit.
    • Configure webServer to optionally start the local stack if it is not running (reference docker-compose.yml).
  3. Authentication Strategy:
    • Implement a setup/auth.setup.ts to handle the login flow once and save the storage state to tests/e2e/.auth/user.json.
    • All subsequent tests should use this storage state to bypass login.
  4. **Directory Structure:
    tests/e2e/
    ├── playwright.config.ts
    ├── package.json
    ├── .auth/ # Gitignored
    ├── setup/
    │ └── auth.setup.ts # Global login logic
    ├── tests/
    │ └── smoke.spec.ts # Initial connectivity check
    └── utils/
    └── shard-api.ts # Helpers to interact with shard_core API

Acceptance Criteria

  • npm run test:e2e executes successfully.
  • Auth state is correctly cached and reused.
  • Documentation provided in tests/e2e/README.md.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions