This folder contains an end-to-end (e2e) smoke test harness for the repository’s examples/.
The goals are:
- Provide a consistent way to smoke-test examples locally and in CI.
- Support multiple example “shapes” (Next-only vs hybrid examples that also have an agent).
- Keep tests lightweight and stable (avoid flakiness, avoid requiring real API keys).
This suite intentionally runs one example at a time.
- The active example is selected via the
EXAMPLEenvironment variable. - If
EXAMPLEis not set, it defaults toform-filling.
The Playwright config (playwright.config.ts) uses EXAMPLE to:
- Set the
webServer.cwdto the chosen example directory (examples/v1/${EXAMPLE}). - Choose the
webServer.commandused to start the app.
Each spec file is gated so that when you run the suite for one example:
- The matching spec runs.
- All other specs skip.
This makes it easy to run a CI matrix (one job per example) while keeping all tests in one folder.
These can be started with:
pnpm dev
Some examples have a Python agent that can be run alongside the UI.
For e2e smoke tests we typically only need the UI to boot, so the Playwright config treats these as “hybrid”:
travelresearch-canvas
For hybrid examples the webServer.command is:
pnpm dev:ui
This avoids starting the Python agent during UI-only smoke tests.
From examples/e2e:
pnpm installpnpm exec playwright install --with-deps chromium
Each example has its own package.json.
Install deps in the example directory you want to test, e.g.:
cd examples/v1/travel && pnpm install
Notes:
- If an example has a
postinstallthat requires non-Node tooling (e.g. Pythonuv), you may want to runpnpm install --ignore-scriptsfor CI-like behavior.
From examples/e2e:
EXAMPLE=form-filling pnpm testEXAMPLE=travel pnpm testEXAMPLE=research-canvas pnpm testEXAMPLE=chat-with-your-data pnpm testEXAMPLE=state-machine pnpm test
When EXAMPLE is set, you should see 1 passed and the other example specs skipped.
- Tests live under
tests/v1.x/. - Each example gets a single smoke spec (minimal assertions).
Examples:
tests/v1.x/form-filling.spec.tstests/v1.x/travel.spec.ts
Keep smoke tests:
- Stable: prefer
getByRoleselectors and obvious headings/buttons. - Cheap: do not rely on LLM outputs.
- Non-invasive: avoid sending chat messages or triggering expensive background work.
Patterns used:
- Gate the spec:
test.skip(EXAMPLE !== "<example>", ...)
- Prefer:
await expect(page).toHaveTitle(/.../)await expect(page.getByRole("heading", { name: "..." })).toBeVisible()
If an example auto-opens Copilot UI / triggers calls, prefer adding a query param to disable it (e.g. travel uses /?copilotOpen=false).
Workflow:
.github/workflows/test_e2e-legacy-v1.yml
It runs a matrix of:
form-fillingtravelresearch-canvaschat-with-your-datastate-machine
Key CI behaviors:
- Installs
examples/e2edeps and Playwright Chromium. - Installs the selected example’s deps.
- Uses
pnpm install --frozen-lockfilefor deterministic installs. - For
research-canvas, installs with--ignore-scriptsto avoid requiring Python tooling just to run UI smoke tests.
Artifacts:
- Always uploads Playwright output (
test-resultsandplaywright-report) for debugging.
- "
next: command not found": the selected example’snode_modulesare missing; runpnpm installin that example directory. - "module not found" for a transitive dep (e.g.
shiki): add it explicitly to the example’s dependencies and reinstall. - Next.js dev warnings about cross-origin (
allowedDevOrigins): currently treated as warnings; tests can still pass.
- Ensure the example can be started via
pnpm dev(Next-only) orpnpm dev:ui(hybrid). - Add a new spec under
tests/v1.x/<example>.spec.ts. - Run locally:
EXAMPLE=<example> pnpm test
- Add the example name to the CI matrix in:
.github/workflows/test_e2e-legacy-v1.yml