e2e-testing

Design and run user-perspective E2E journeys for ScienceDiscovery via Playwright, HTTP API, or CLI.

64|15|Updated Aug 14, 2026
One-click install
npx skills add https://github.com/openJiuwen-ai/sciencediscovery --skill e2e-testing-openjiuwen-ai
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: e2e-testing
Source: https://github.com/openJiuwen-ai/sciencediscovery/tree/main/.agents/skills/e2e-testing
Command: npx skills add https://github.com/openJiuwen-ai/sciencediscovery --skill e2e-testing-openjiuwen-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @playwright/test.

What problem does it solve? It ensures that changes to the ScienceDiscovery product are validated from a real user's perspective, covering browser, public HTTP API, CLI, and local-stack journeys, instead of relying on internal unit or module-level tests that miss user-observable regressions. ## Core Features & Use Cases - Journey-based browser testing: Write Playwright specs organized by user goals with mandatory E2E-META metadata, journey steps, and automatic per-step reports with screenshots. - Mocked and real test groups: Run deterministic credential-free mocked journeys by default, with explicit opt-in (E2E_REAL=1) for live LLM, search, or connector tests that declare cost and side effects. - Isolated stack per run: Start an isolated product stack with dedicated ports, data directories, and tokens so parallel runs never interfere, and record BLOCKED vs PASS/FAIL outcomes honestly. - Use Case: After changing run cancellation behavior, add a journey that starts a run, cancels it, and verifies the user-visible feedback, then run the mocked suite against the committed target SHA in an isolated worktree. ## Quick Start Ask the agent to design and run an E2E journey for the changed user-observable behavior using the pinned Playwright environment and an isolated local stack.

Frequently Asked Questions about e2e-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run E2E tests for ScienceDiscovery?▼

Synchronize the pinned environment with node test/sync-e2e.mjs --write, install it in .e2e/, start an isolated stack via ./scripts/start-stack.sh --mode local, then run npm run test:mocked from .e2e/. The mocked group is the default and needs no credentials.

What counts as an E2E test versus a unit test here?▼

E2E means simulating actual product use from a user goal to an observable outcome through a real entry point: browser, public HTTP API, CLI, or local stack. Package tests, in-process calls to internal functions, or assertions that only prove a click happened do not qualify.

How do I run real LLM tests with Playwright?▼

Set E2E_REAL=1 so the real Playwright project is defined, provide E2E_LLM_BASE_URL, E2E_LLM_MODEL, and E2E_LLM_TOKEN, then run npm run test:real. Each real test must call requireRealEnv and requireRealStack at the start of its body.

Why does my E2E run fail with missing token or port errors?▼

The browser global setup fails when E2E_API_TOKEN is absent, and the API ignores SCIENCE_AGENT_RUNNER_PORT unless SCIENCE_AGENT_RUNNER_URL is also set. Export all isolation variables explicitly and record the run as BLOCKED when a prerequisite is missing.

Can I use npx playwright or a global Playwright install?▼

No. Only the @playwright/test version declared in test/e2e.package.json and assembled into .e2e/ is allowed. The fail-closed sync-e2e.mjs --check runs before every npm test command and rejects mismatched environments.

When is E2E coverage not applicable for a change?▼

Only when no user-observable product path is affected, such as documentation-only changes, and you must write E2E: not applicable with a reason. Backend-only changes without new UI are not an exemption; missing environments are BLOCKED, not exempt.