跳到正文
cccskills
免费在 GitHub 公开

playwright-screen-recording

Record Playwright browser test actions as .webm videos for pull request reviews, bug fix comparisons, and regression evidence. Combine readable pauses, assertions, and terminal logs to show interface behavior alongside automated checks.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

Record browser test videos with Playwright for PR review and bug fix verification

集成工具Playwright
查看安装方法

适用场景

  • Recording before-and-after behavior for a bug fix
  • Sharing interface changes in a pull request review
  • Saving video evidence of regression test paths
  • Checking behavior with both video and terminal logs

包含的文件(1)

  • SKILL.md2.8 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

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

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Test real Codex CLI sessions through claude-tap, including resumed conversations, multiple tool calls, and image input. Check captured API activity and viewer behavior, then collect screenshots as evidence for a pull request.

中文简介正在准备中。当前显示英语简介。

  • Validate API capture and proxy changes
  • Test resumed conversations with image input
  • Check message rendering and tool call order
liaohch3/claude-tap33052026年10月22日 更新

Create demo GIFs and MP4 videos from real terminal test runs recorded with tmux and asciinema. Capture HTML viewer screenshots through Playwright, with guidance for selecting visible controls and scrolling the correct page containers.

中文简介正在准备中。当前显示英语简介。

  • Record a real terminal test run as a demo
  • Convert a terminal recording into GIF and MP4 files
  • Capture HTML viewer entries and diff screens
liaohch3/claude-tap33052026年10月22日 更新

e2e-test

免费

Run pytest tests for claude-tap after core changes to check the workflow from end to end. Review results for proxy processing, trace storage, cleanup, and viewers, with guidance on where to investigate failures.

中文简介正在准备中。当前显示英语简介。

  • Check the full workflow after proxy changes
  • Verify trace cleanup behavior
  • Check that startup avoids update network requests
liaohch3/claude-tap33052026年10月22日 更新

Test JavaScript embedded in HTML with two complementary layers: Python unit tests for algorithms and Playwright browser tests for page behavior. Check calculations, button states, keyboard input, and navigation using prepared test data.

中文简介正在准备中。当前显示英语简介。

  • Checking algorithms embedded in HTML
  • Testing button states and overlay visibility
  • Verifying keyboard and click navigation
liaohch3/claude-tap33052026年10月22日 更新

Check maintainer documentation locally before automated CI checks run. Find missing metadata, outdated review dates, nonexistent paths in the architecture manifest, and completed plans that still contain unfinished tasks, with guidance for correcting common failures.

中文简介正在准备中。当前显示英语简介。

  • Check required metadata after updating standards
  • Find outdated review dates
  • Verify paths listed in the architecture manifest
liaohch3/claude-tap33052026年10月22日 更新

Check whether a pull request is ready to merge by combining local lint, formatting, and tests with GitHub Actions status and PR description requirements. Returns a readiness verdict with specific reasons for any failed checks.

中文简介正在准备中。当前显示英语简介。

  • Running local checks before opening a pull request
  • Reviewing an existing pull request’s merge readiness
  • Finding failing or pending GitHub Actions checks
liaohch3/claude-tap33052026年10月22日 更新

查看 liaohch3 的全部技能

报告此技能的问题