Playwright
@decoyhq/playwright routes your browser's API calls to decoy, gives each test its own Session, and
exposes the Control API as a fixture.
playwright.config.ts
global-setup.ts
tests/fixtures.ts
Next, switch responses in a test. For a page that opens a socket, bridge browser WebSockets.
Options (use.decoyOptions)
Decoy is off for projects without decoyOptions. setup starts one Decoy per distinct url:
projects that share a url share a Decoy, and each other url gets its own command. command
runs with node_modules/.bin (from cwd up) on PATH. Teardown sends SIGTERM and, if Decoy hasn't
exited after 8s, SIGKILL (Windows: taskkill /T /F). Projects that share a url must agree on
command, cwd, reuseExistingServer and timeout, or setup fails.
The runnable version of all this is
examples/playwright-ts-e2e.