Skip to main content
Document Type: PRD
Product: TestSprite integration for Encore OS
Version: 1.0.0
Last Updated: 2026-03-10
Status: Draft

1. Overview

1.1 Purpose

This PRD defines the product requirements for TestSprite integration within the Encore OS platform. TestSprite provides AI-powered autonomous testing (frontend E2E and backend API) via an MCP (Model Context Protocol) server in Cursor, enabling developers and AI assistants to generate test plans, execute tests in the cloud, and consume structured reports without maintaining large hand-written E2E suites for every change.

1.2 Scope

  • In scope: Use of TestSprite MCP in Cursor for frontend (UI) and backend (API) test generation and execution; configuration, workflows, and consumption of test reports for this repository.
  • Out of scope: TestSprite’s internal product roadmap; replacement of existing Vitest/Playwright/RLS test suites; CI/CD integration (future phase).

1.3 References


2. Goals and Success Criteria

2.1 Goals

2.2 Success Criteria


3. User Personas and Use Cases

3.1 Personas

3.2 Use Cases


4. Functional Requirements

4.1 Configuration and Bootstrap

4.2 Test Plan Generation

4.3 Test Execution

4.4 Reports and Follow-up

4.5 Application and Environment


5. Non-Functional Requirements

5.1 Security and Compliance

5.2 Usability and Documentation

5.3 Compatibility and Dependencies


6. User Flows (High Level)

6.1 First-Time Setup

  1. Developer installs Node ≥22 and creates TestSprite account.
  2. Developer adds TestSprite MCP in Cursor with API key in env.
  3. Developer runs “Can you test this project with TestSprite?” (or equivalent).
  4. AI runs bootstrap (no config yet); user completes browser config (type, scope, credentials, URLs, optional PRD).
  5. Config and (after plan generation) test plan files appear under testsprite_tests/.
  6. First execute produces a report.

6.2 Subsequent Frontend Test Run (with login)

  1. Developer starts app: npm run dev or npm run build && npm run preview.
  2. Developer (or AI) triggers TestSprite test run with auth credentials and additionalInstruction for Supabase redirect.
  3. AI generates frontend test plan (if needed) then calls generate_code_and_execute.
  4. TestSprite runs tests; report is written to testsprite_tests/.
  5. Developer or AI reads report and optionally applies fixes and re-runs.

6.3 Production-Mode Full Run

  1. Developer runs npm run build && npm run preview and confirms app at http://localhost:8080.
  2. Developer asks AI to run TestSprite with serverMode: "production".
  3. Full test set runs; report is generated.
  4. Report used for release sign-off or fix list.

7. Out of Scope (Current Phase)

  • CI/CD integration (e.g. GitHub Actions calling TestSprite).
  • Replacing or merging existing Vitest/Playwright/RLS suites with TestSprite.
  • TestSprite product features not exposed via current MCP tools.
  • Commitment to a specific TestSprite pricing tier or quota.

8. Dependencies and Constraints

8.1 Dependencies

  • TestSprite cloud service and MCP server availability.
  • Cursor IDE with MCP support.
  • Node.js ≥22.
  • Running Encore OS frontend (and optionally backend) during test execution.
  • TestSprite account and valid API key.

8.2 Constraints

  • Test plan file must exist before execute (generated in same flow or previous run).
  • Auth flows require explicit wait instruction for async redirect (Supabase).
  • Dev mode limits frontend tests (e.g. 15) to avoid overload; production mode for full set.
  • testsprite_tests/ is gitignored; no in-repo history of reports or config.

9. Open Questions and Future Work


10. Approval and Revision History


See also: TESTSPRITE.md for setup and runbooks; README.md for the testing pyramid and other test types.