Testplane
@decoyhq/testplane is a Testplane plugin. It starts decoy for the run,
gives each test its own Session, routes the browser's API calls to Decoy, and exposes the Control
API as decoy(browser).
The setup is one plugins entry:
Next, switch responses in a test.
Options
A urls glob matches the full request URL, as in Playwright: * stays within a path segment,
** crosses them, and {api,graphql} matches either. It must start with * or a scheme
('**/api/**', 'http://localhost:3000/api/**'). The plugin throws on load for a glob like
'/api/**', which could never match. Requests that match nothing go to the real network.
command runs with node_modules/.bin (from cwd up) on PATH. At the end of the run the plugin
sends SIGTERM and, if Decoy hasn't exited after 8s, SIGKILL (Windows: taskkill /T /F).
Limits
- Routing (
urls) needs Chrome or Chromium: it uses CDP throughbrowser.getPuppeteer(), in WebDriver Classic and BiDi (webSocketUrl: true) sessions alike. On other browsers each test fails with a clear error. - Testplane reuses a browser for many tests, so a request still in flight when a test ends can reach the next test's Session. Wait for your page to settle before a test ends.
The runnable version of all this is
examples/testplane-ts-e2e.