How to Replicate

Pipeline script, config & commands

Download a sample video, add the pipeline script and config, then run the pipeline to generate a Playwright spec.

1. Get a video

Play or download any sample. Place it in a videos/ folder, or use your own recording.

Playground Pro – Predictor & Vault
Download
Strategy Board Game – Custom Scenario
Download
YouTube – LLM Deep Dive
Download
Hacker News – Nav Tour From Google
Download
ChatGPT Incognito Greeting
Download

2. Required files

You only need these:

project/ ├── sample_pipeline.js ← pipeline script (use repo file) ├── .env ← config (see below) └── videos/ └── video1.webm ← your video(s)

Copy sample_pipeline.js from this repo. Rename to pipeline.js if you prefer; the script is the same.

3. Configuration

Create a .env file in the same directory as the pipeline script:

# Required: LLM Foundry token
LLMFOUNDRY_TOKEN=your_token_here

# Optional (defaults shown)
MODEL=gemini-2.0-flash
FPS=1
MAX_FRAMES=40
PROJECT=playwright-pipeline

The pipeline uses Gemini via LLM Foundry. Get a token from your provider and set LLMFOUNDRY_TOKEN. Other variables are optional.

4. Full pipeline.js code (copy to replicate)

Generic, accurate pipeline: video → frames (FFmpeg) → vision + codegen (Gemini) → Playwright spec. Copy the code below into pipeline.js (or sample_pipeline.js) in your project.

Loading pipeline.js…

5. Commands

  • Install FFmpeg (if needed) and Node.js (v18+). Then run the pipeline:
    node sample_pipeline.js videos/video1.webm
    Replace video1.webm with your file. Output is written to scripts/video1/video1.spec.js (or the matching name).
  • Install Playwright and run the generated spec:
    npx playwright install --with-deps chromium
  • Run the test (headed):
    npx playwright test scripts/video1/video1.spec.js --browser=chromium --headed
Back to dashboard