This example demonstrates how to run Playwright tests in a Cloudflare Worker using the TodoMVC application.
- Screenshots of TodoMVC app with custom todo items
- Optional trace generation
- Runs completely in Cloudflare Workers
- Install dependencies:
npm ci- Build the project:
npm run build- Deploy to Cloudflare Workers:
npm run deployOnce deployed, you can interact with the Worker using these URL patterns:
https://<your-worker>.workers.dev
Returns a screenshot of the TodoMVC app with default todo items.
To generate a trace and open it in Playwright Trace Viewer, use the following URL:
https://trace.playwright.dev/?trace=https://<your-worker>.workers.dev
To download the trace, use the following URL:
https://<your-worker>.workers.dev?trace