browser-recording
Scannednpx machina-cli add skill athola/claude-night-market/browser-recording --openclawTable of Contents
- Overview
- Required TodoWrite Items
- Process
- Step 1: Validate Playwright Installation
- Step 2: Check Spec File
- Step 3: Execute Recording
- Step 4: Convert to GIF
- Example Playwright Spec
- Playwright Configuration
- Exit Criteria
- Error Handling
- Output Locations
- See Also
Browser Recording Skill
Record browser sessions using Playwright to create video captures of web UI interactions for tutorials and documentation.
When To Use
- Recording browser sessions with Playwright
- Creating web application demo recordings
When NOT To Use
- Terminal-only workflows - use scry:vhs-recording instead
- Static screenshots - use standard screenshot tools
Overview
This skill uses Playwright's built-in video recording to capture browser interactions. The workflow:
- Validate Playwright installation
- Execute a Playwright spec with video recording enabled
- Retrieve the recorded video (WebM format)
- Convert to GIF using the gif-generation skill
💡 Note: Claude Code 2.0.72+ includes native Chrome integration for interactive browser control. This skill (Playwright) is designed for automated recording workflows, CI/CD, and cross-browser support. For interactive debugging and live testing, consider using native Chrome integration. Both approaches complement each other - develop interactively with Chrome, then automate with Playwright specs.
Required TodoWrite Items
When invoking this skill, create todos for:
- [ ] Validate Playwright is installed and configured
- [ ] Check spec file exists at specified path
- [ ] Execute Playwright spec with video recording
- [ ] Locate and verify video output
- [ ] Convert video to GIF using gif-generation skill
Verification: Run the command with --help flag to verify availability.
Process
Step 1: Validate Playwright Installation
Check that Playwright is available:
npx playwright --version
Verification: Run the command with --help flag to verify availability.
If not installed, the user should run:
npm install -D @playwright/test
npx playwright install chromium
Verification: Run pytest -v to verify tests pass.
Step 2: Check Spec File
Verify the Playwright spec file exists. Spec files should:
- Be located in a
specs/ortests/directory - Have
.spec.tsor.spec.jsextension - Include video configuration (see spec-execution module)
Step 3: Execute Recording
Run the spec with video enabled:
npx playwright test <spec-file> --config=playwright.config.ts
Verification: Run pytest -v to verify tests pass.
The config must enable video recording. See the spec-execution module for configuration details.
Step 4: Convert to GIF
After recording completes, use the gif-generation skill to convert the WebM video to an optimized GIF:
**Verification:** Run the command with `--help` flag to verify availability.
Invoke scry:gif-generation with:
- input: <path-to-webm>
- output: <desired-gif-path>
- fps: 10 (recommended for tutorials)
- width: 800 (adjust based on content)
Verification: Run the command with --help flag to verify availability.
Example Playwright Spec
import { test, expect } from '@playwright/test';
test('demo workflow', async ({ page }) => {
// Navigate to the application
await page.goto('http://localhost:3000');
// Wait for page to be ready
await page.waitForLoadState('networkidle');
// Perform demo actions
await page.click('button[data-testid="start"]');
await page.waitForTimeout(500); // Allow animation to complete
await page.fill('input[name="query"]', 'example search');
await page.waitForTimeout(300);
await page.click('button[type="submit"]');
await page.waitForSelector('.results');
// Final pause to show results
await page.waitForTimeout(1000);
});
Verification: Run pytest -v to verify tests pass.
Playwright Configuration
Create or update playwright.config.ts:
import { defineConfig } from '@playwright/test';
export default defineConfig({
use: {
video: {
mode: 'on',
size: { width: 1280, height: 720 }
},
viewport: { width: 1280, height: 720 },
launchOptions: {
slowMo: 100 // Slow down actions for visibility
}
},
outputDir: './test-results',
});
Verification: Run pytest -v to verify tests pass.
Exit Criteria
- Playwright spec executed successfully (exit code 0)
- Video file exists in output directory
- Video has non-zero file size
- GIF conversion completed (if requested)
Error Handling
| Error | Resolution |
|---|---|
| Playwright not installed | Run npm install -D @playwright/test |
| Browser not installed | Run npx playwright install chromium |
| Spec file not found | Verify path and file extension |
| Video not created | Check Playwright config has video enabled |
| Empty video file | validate spec actions complete before test ends |
Output Locations
Default output paths:
- Videos:
./test-results/<test-name>/video.webm - Screenshots:
./test-results/<test-name>/screenshot.png
Module Reference
- See
modules/spec-execution.mdfor detailed Playwright execution options - See
modules/video-capture.mdfor video format and quality settings
See Also
- scry:gif-generation: Convert video to optimized GIF
Troubleshooting
Common Issues
Command not found Ensure all dependencies are installed and in PATH
Permission errors Check file permissions and run with appropriate privileges
Unexpected behavior
Enable verbose logging with --verbose flag
Source
git clone https://github.com/athola/claude-night-market/blob/master/plugins/scry/skills/browser-recording/SKILL.mdView on GitHub Overview
This skill uses Playwright to capture browser interactions as video for tutorials and documentation. It automates validation, recording, and conversion to GIF, making it ideal for demos, CI/CD pipelines, and cross-browser UI walkthroughs. The process ends with a GIF created from the recorded WebM video using the gif-generation skill.
How This Skill Works
Validate that Playwright is installed, run a Playwright spec with video recording enabled, then retrieve the produced WebM video and convert it to a GIF using the gif-generation skill. The workflow relies on a Playwright config that enables video recording and a spec located in specs/ or tests/.
When to Use It
- Recording browser sessions with Playwright for tutorials and documentation
- Creating web application demo recordings for product tours
- Automated demos in CI/CD pipelines
- Cross-browser UI walkthroughs to accompany tests and docs
- Documentation videos showing interactive web UI flows
Quick Start
- Step 1: Validate Playwright installation: npx playwright --version. If missing, run: npm install -D @playwright/test && npx playwright install chromium
- Step 2: Run the Playwright spec with video enabled: npx playwright test <spec-file> --config=playwright.config.ts
- Step 3: Convert the produced WebM to GIF: invoke scry:gif-generation with input:<path-to-webm>, output:<desired-gif-path>, fps:10, width:800
Best Practices
- Validate Playwright installation before attempting a recording
- Store specs under specs/ or tests/ and name them with .spec.ts or .spec.js
- Ensure the Playwright config enables video recording
- Keep recordings concise and focused on the UI flow; trim unnecessary parts
- Convert the WebM video to GIF with fps 10 and width 800 for tutorials
Example Use Cases
- Tutorial video showing a user login flow in a SaaS app, recorded with Playwright and converted to a GIF for documentation
- Product demo capturing a product search and filter workflow for a marketing site
- Admin panel walkthrough illustrating dashboard widgets and interactions
- Checkout flow demonstration video for an e-commerce site
- Onboarding sequence walkthrough captured for internal developer docs
Frequently Asked Questions
Related Skills
media-composition
athola/claude-night-market
Combine media assets (GIFs, videos) into composite tutorials with vertical/horizontal
vhs-recording
athola/claude-night-market
Generate terminal recordings using VHS tape files, produces GIF outputs.
gif-generation
athola/claude-night-market
Post-process video files and generate optimized GIFs. Converts webm/mp4