Agent Skillsliaohch3/claude-tap › playwright-screen-recording

playwright-screen-recording

GitHub

利用Playwright录制浏览器测试视频,用于PR代码审查和Bug修复验证。支持无头模式,生成.webm格式视频以直观展示UI变化、交互行为及回归测试结果,辅助开发者与评审人员理解变更细节。

.agents/skills/playwright-screen-recording/SKILL.md liaohch3/claude-tap

Trigger Scenarios

需要录制前端交互视频用于PR审查 需要可视化证据验证Bug修复效果 需要记录回归测试的视觉证明

Install

npx skills add liaohch3/claude-tap --skill playwright-screen-recording -g -y
More Options

Non-standard path

npx skills add https://github.com/liaohch3/claude-tap/tree/main/.agents/skills/playwright-screen-recording -g -y

Use without installing

npx skills use liaohch3/claude-tap@playwright-screen-recording

指定 Agent (Claude Code)

npx skills add liaohch3/claude-tap --skill playwright-screen-recording -a claude-code -g -y

安装 repo 全部 skill

npx skills add liaohch3/claude-tap --all -g -y

预览 repo 内 skill

npx skills add liaohch3/claude-tap --list

SKILL.md

Frontmatter
{
    "name": "playwright-screen-recording",
    "description": "Record browser test videos with Playwright for PR review and bug fix verification",
    "user_invocable": false
}

Playwright Screen Recording for Test Verification

Use Playwright's video recording to capture headless browser operations as .webm videos for PR review or bug fix verification.

Core Usage

from playwright.sync_api import sync_playwright
import tempfile
from pathlib import Path

video_dir = Path(tempfile.mkdtemp())

with sync_playwright() as pw:
    browser = pw.chromium.launch(headless=True)
    context = browser.new_context(
        viewport={"width": 1400, "height": 900},
        record_video_dir=str(video_dir),
        record_video_size={"width": 1400, "height": 900},
    )
    page = context.new_page()
    page.goto(f"file:///path/to/test.html")

    # ... perform test actions, add pauses for readability ...
    page.wait_for_timeout(800)  # pause so viewers can see the current state

    page.close()
    context.close()  # video is finalized after context.close()
    browser.close()

# Retrieve the recorded video
videos = list(video_dir.glob("*.webm"))
if videos:
    videos[0].rename("demo.webm")

Use Cases

  • Bug fix verification: record before/after comparisons showing button state changes, UI behavior differences
  • PR Review: attach .webm video so reviewers can visually understand the change
  • Regression test evidence: record critical interaction paths as visual proof of passing tests

Recording Tips

Add pauses between actions

page.click(".some-button")
page.wait_for_timeout(800)  # let viewers see the click effect

page.keyboard.press("ArrowRight")
page.wait_for_timeout(600)  # let viewers see the navigation result

Combine assertions with terminal logging

state = get_nav_state(page)
print(f"[1] Title: {state['title']}")
print(f"    prev disabled: {state['prevDisabled']}  (expected: True)")
assert state["prevDisabled"] is True
print("    PASS")

Terminal output paired with the recorded video provides dual verification.

Prefer real data

Use existing real trace data from the project rather than synthetic data for more convincing demos:

# Build test HTML from a real trace file
records = []
with open(".traces/trace_xxx.jsonl") as f:
    for line in f:
        # Escape </script> to prevent breaking the HTML script block
        records.append(line.strip().replace("</script>", '</scr" + "ipt>'))

Notes

  • Video format is .webm (VP8 codec), supported by most players and browsers
  • Each page produces a separate video file
  • record_video_size controls video resolution — keep it consistent with viewport
  • Recording works in headless mode, no display required
  • Video files are typically a few hundred KB, suitable for attaching to PRs or chat

Version History

  • 6cfe45a Current 2026-07-31 07:42
  • 7170ab3 2026-07-05 15:20

Same Skill Collection

.agents/skills/codex-e2e-test/SKILL.md
.agents/skills/demo-video/SKILL.md
.agents/skills/js-in-html-testing/SKILL.md
.agents/skills/legibility-check/SKILL.md
.agents/skills/pr-preflight/SKILL.md
.agents/skills/push-release/SKILL.md
.agents/skills/real-e2e-test/SKILL.md
.agents/skills/screenshot-validation/SKILL.md
.agents/skills/translate-i18n/SKILL.md
.agents/skills/e2e-test/SKILL.md

Metadata

Files
0
Version
198ad96
Hash
7d38a7a3
Indexed
2026-07-05 15:20

Home - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-06 21:17
浙ICP备14020137号-1 $Map of visitor$