Skip to content

Latest commit

 

History

History

README.md

Playwright Cloudflare TodoMVC Example

Deploy to Cloudflare

This example demonstrates how to run Playwright tests in a Cloudflare Worker using the TodoMVC application.

Features

  • Screenshots of TodoMVC app with custom todo items
  • Optional trace generation
  • Runs completely in Cloudflare Workers

Setup

  1. Install dependencies:
npm ci
  1. Build the project:
npm run build
  1. Deploy to Cloudflare Workers:
npm run deploy

Usage

Once deployed, you can interact with the Worker using these URL patterns:

Capture Screenshot

https://<your-worker>.workers.dev

Returns a screenshot of the TodoMVC app with default todo items.

Generate Trace

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