docs(reference): list the CANCELLED that test code calls raise as a test error

Merged
LE
3d ago
+2-1

This PR takes the follow-up from the review of #2411.

What

  • The errors reference now says that test.step(), a request call, or a call on an engine's fixture (such as browser.evaluate) can fail with CANCELLED of class test, not only the infrastructure one.

Why

  • The only CANCELLED row (Agent codes) gives class infrastructure, and it names no test.step() case. A test.step() called from work its phase left running throws a TestError (test-step.ts:24-27), as the #2411 review pointed out. The same holds for a step, request call, or fixture call cut while it runs.

How it works

  1. docs/reference/errors.mdx:209 adds a CANCELLED row to Test code errors: a test.step(), request call, or contributed fixture call cut short while it ran (steps.ts:754, steps.ts:942, request.ts:68, fixture-recording.ts:80), and a test.step() called from work its phase left running (test-step.ts:24-27). Class test, exit 1.
  2. docs/reference/errors.mdx:119: the Agent codes CANCELLED row gets one sentence pointing to that row. Its class and other text are unchanged.

Issue

Docs-only, so no issue (CONTRIBUTING). The gap was named in the #2411 review.

Verified

Ran it locally: yes - a throwaway runProject probe (not committed) with a 2 s test timeout and a 4 s afterEach, so the engine stays open. Each call is caught and its error logged:

in-flight test.step          TestError  CANCELLED  test            test.step cancelled
late test.step               TestError  CANCELLED  test            test.step() was called after its test ended
in-flight request.get        TestError  CANCELLED  test            GET http://127.0.0.1:<port>/slow cancelled
in-flight browser.evaluate   TestError  CANCELLED  test            browser.evaluate cancelled
in-flight locator.tap        E2EError   CANCELLED  infrastructure  operation cancelled
late locator.tap             E2EError   CANCELLED  infrastructure  operation cancelled
mainthis PR
CANCELLED of class test in errors.mdxnot listedTest code errors row
  • pnpm check and pnpm test pass (pnpm test exit 0, e.g. packages/e2e 6722 passed, 15 skipped; docs:check-errors: 98 codes documented; translation drift unchanged at 290). No screenshot: two table cells change, and docs:check compiles the page.
  • Not changed: the translations, which may lag. #2411 adds the late-call case to the test.step Throws table in test.mdx.

Checklist

  • Changeset added (pnpm changeset) for any change to a published package, or the change is testbed, docs, or CI only.
  • Breaking change: title carries !, the changeset body names what breaks and what replaces it, and the deprecation warning landed a window earlier (stability policy in CONTRIBUTING.md).
  • Docs updated in the same PR: the docs/**/*.mdx page for the behavior, and skills/e2e/ if the skill describes it.
  • Contract change: emitted .d.ts reviewed, tests/types/sdk-types.ts updated; wire change edits the schema and both fixtures.
  • Engine contract change (e2e/engine): changesets for e2e, @e2e-dev/web, and @e2e-dev/mobile.

Summary by CodeRabbit

  • Documentation
    • Documented CANCELLED errors for runner-cancelled operations, including work stopped by a signal, a closed session, or a body or hook timeout.