Skip to content

Add Playwright e2e tests for WebSocket and API integration #139

Description

@JohnRDOrazio

Summary

All existing tests (756 files) rely on mocked dependencies — fetch is stubbed, WebSocket is replaced with MockWebSocket, and contexts are provided via test wrappers. We need end-to-end tests that exercise the full stack against a real running backend to catch integration failures, WebSocket lifecycle issues, and real auth flows.

Plan

A detailed plan has been committed to dev at docs/plans/e2e-testing.md. It covers:

Test categories

  • API integration tests — Playwright APIRequestContext hitting the real backend (project CRUD, ontology ops, branches, PRs, lint, search)
  • WebSocket tests — raw ws connections for protocol-level testing + browser-based WebSocket interception for collab and index-status endpoints
  • UI workflow tests — full browser journeys (auth, ontology editing, branch+PR workflow, health check)

Implementation phases

  1. Foundation — Install Playwright, auth fixtures, API integration tests, CI docker-compose
  2. WebSocket tests — collab handshake, presence, index-status WS, reconnection
  3. UI workflow tests — auth flow, project management, ontology editing, branch+PR
  4. CI hardening — multi-browser matrix, flaky test detection, trace artifacts

Open questions

  • Auth strategy for CI (service account vs test bypass header)
  • Test database seeding (Alembic + SQL fixtures vs API calls)
  • Scope boundary (ontokit-web vs monorepo-level e2e/ directory)
  • MinIO requirement for initial phases

References

  • Plan document: docs/plans/e2e-testing.md on dev

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions