# Where to Find the End-to-End (E2E) Test Plan for PI-Desktop

> Locate the official PI-Desktop End-to-End E2E test plan in the vastsa/PI-Desktop repository. Discover testing strategy, tooling, and merge gates for comprehensive E2E testing.

- Repository: [Lan/PI-Desktop](https://github.com/vastsa/PI-Desktop)
- Tags: how-to-guide
- Published: 2026-09-12

---

**The authoritative End-to-End (E2E) test plan for PI-Desktop resides in [`docs/spec/06-delivery/04-e2e-test-plan.md`](https://github.com/vastsa/PI-Desktop/blob/main/docs/spec/06-delivery/04-e2e-test-plan.md), with a Chinese translation available at [`docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md`](https://github.com/vastsa/PI-Desktop/blob/main/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md).** Both documents define the testing strategy, tooling requirements, and mandatory merge gates for the Electron-based desktop application.

The **PI-Desktop** repository (vastsa/PI-Desktop) maintains a comprehensive End-to-End (E2E) testing strategy documented in its specification tree. Understanding where to find this test plan and how to execute its scenarios is essential for contributors validating cross-system integrations between the Rust host core, IPC bridge, and Electron frontend.

## Locating the E2E Test Plan Documentation

### Primary Specification File

The master document is stored at [`docs/spec/06-delivery/04-e2e-test-plan.md`](https://github.com/vastsa/PI-Desktop/blob/main/docs/spec/06-delivery/04-e2e-test-plan.md). This markdown file serves as the single source of truth for testing goals, non-goals, and the test pyramid architecture balancing unit, integration, and E2E layers. According to the source code structure, the repository root `README` points to this spec directory for navigation.

### Localization Support

A Chinese translation exists at [`docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md`](https://github.com/vastsa/PI-Desktop/blob/main/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md), mirroring the structure and technical requirements of the English version for international contributors. Both files maintain identical scenario IDs and acceptance criteria.

## Key Components of the E2E Test Plan

The document outlines several critical domains for validation:

### Testing Strategy and Tooling

The plan specifies the current active toolchain including **Vitest** for TypeScript integration tests, **Rust tests** in `crates/host-core/tests/*`, protocol smoke tests, and Electron boot probes. It also forecasts the migration to **Playwright** for full UI automation coverage.

### Scenario Templates and IDs

Every E2E scenario follows a standardized markdown template including preconditions, execution steps, expected results, linked specifications, acceptance criteria, milestone tags, and current status. Concrete MVP scenarios include:

- `E2E-001`: Application launch validation
- `E2E-002`: IPC bridge functionality
- `E2E-097`: Tool burst recovery mechanisms

### Environment and Merge Requirements

The document details platform requirements, fixture configurations, and sample plugins needed for reliable test execution. It mandates that all code-bearing PRs must pass specific `pnpm test:e2e*` commands before merging, with strict failure classification policies that block merges on regressions.

## Executing E2E Tests Locally

Contributors can validate changes against the test plan using several npm scripts defined in [`package.json`](https://github.com/vastsa/PI-Desktop/blob/main/package.json).

### Running the Full Smoke Suite

To execute the default cross-system validation:

```bash

# From repository root

pnpm test:e2e

```

This command runs protocol smoke tests and Electron boot checks that verify host-core RPC contracts and basic application startup.

### Targeted Test Execution

For focused validation of specific subsystems:

```bash

# UI interaction tests covering E2E-001, E2E-002, and E2E-003

pnpm test:e2e:plan

# Boot supervision and crash recovery validation

pnpm test:e2e:boot

```

### Individual Scenario Testing

To run a specific scenario without executing the entire suite:

```bash
node scripts/e2e-plan.mjs --scenario E2E-097

```

This executes only the "Tool burst is bounded and recovers after host restart" validation, saving time during targeted debugging of recovery mechanisms.

## Supporting Test Infrastructure

Beyond the markdown specification, the E2E system relies on several critical directories:

- `scripts/e2e/*.mjs`: Helper scripts for boot supervision, plan validation, and scenario execution
- `scripts/e2e-electron-boot.mjs`: Default smoke test runner for Electron startup validation
- `apps/desktop/test/*.test.mjs`: Vitest integration suites for TypeScript components
- `crates/host-core/tests/*`: Rust unit and integration tests for the host core
- [`package.json`](https://github.com/vastsa/PI-Desktop/blob/main/package.json): Source of truth for all `pnpm test:e2e*` command definitions

## Summary

- The **End-to-End (E2E) test plan for PI-Desktop** is located at [`docs/spec/06-delivery/04-e2e-test-plan.md`](https://github.com/vastsa/PI-Desktop/blob/main/docs/spec/06-delivery/04-e2e-test-plan.md) with a Chinese translation at [`docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md`](https://github.com/vastsa/PI-Desktop/blob/main/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md)
- The document defines testing goals, the test pyramid, and mandates **Vitest**, **Rust tests**, and planned **Playwright** automation
- Specific scenario IDs like `E2E-001`, `E2E-002`, and `E2E-097` track MVP functionality from boot to recovery
- Merge gates require passing `pnpm test:e2e`, `pnpm test:e2e:plan`, or `pnpm test:e2e:boot` commands before PR approval
- Helper scripts in `scripts/e2e/` provide granular control over test execution via flags like `--scenario`

## Frequently Asked Questions

### What file contains the official E2E test plan for PI-Desktop?

The authoritative document is [`docs/spec/06-delivery/04-e2e-test-plan.md`](https://github.com/vastsa/PI-Desktop/blob/main/docs/spec/06-delivery/04-e2e-test-plan.md) in the repository root. This markdown file contains the complete testing strategy, scenario templates, and merge gate policies required for contribution according to the vastsa/PI-Desktop source code.

### Does PI-Desktop support localized versions of the test documentation?

Yes. A Chinese translation exists at [`docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md`](https://github.com/vastsa/PI-Desktop/blob/main/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md), maintaining parity with the English specification regarding technical requirements, scenario definitions, and acceptance criteria.

### Which command runs the complete E2E validation suite?

Execute `pnpm test:e2e` from the repository root to run the full smoke suite, including protocol validation, Electron boot checks, and host-core RPC verification. This command must pass before merging code-bearing pull requests.

### How do I run a specific E2E scenario like E2E-097?

Use the helper script with the scenario flag: `node scripts/e2e-plan.mjs --scenario E2E-097`. This executes only the "Tool burst recovery" test without running the entire catalog, saving time during targeted debugging of the recovery mechanisms.