원클릭으로
playwright-screen-recording
Record browser test videos with Playwright for PR review and bug fix verification
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Record browser test videos with Playwright for PR review and bug fix verification
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | playwright-screen-recording |
| description | Record browser test videos with Playwright for PR review and bug fix verification |
| user_invocable | false |
Use Playwright's video recording to capture headless browser operations as .webm videos for PR review or bug fix verification.
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")
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
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.
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>'))
.webm (VP8 codec), supported by most players and browserspage produces a separate video filerecord_video_size controls video resolution — keep it consistent with viewportRun PR-grade real Codex E2E validation through claude-tap, including resume turns, multiple tool calls, optional image input, viewer verification, and screenshot evidence.
Run claude-tap end-to-end tests with pytest
Full pre-PR merge-readiness check. Run this before opening or merging a pull request — it validates local gates (lint, format, tests), CI status, screenshot evidence, and PR metadata in one pass. Also useful for reviewing an existing PR's readiness.
Test JS logic embedded in HTML using two-layer strategy - Python unit tests + Playwright browser integration tests
Fill missing i18n translations in the viewer source JSON. Run this after adding or modifying English or Chinese UI strings in claude_tap/viewer_i18n.json — it auto-translates to ja, ko, fr, ar, de, ru via OpenRouter.
Validate screenshot and viewer HTML quality for PR evidence. Run this after adding or modifying images under .agents/evidence/pr/ or .agents/recordings/, or after generating a new viewer HTML file. Combines image quality checks (resolution, blankness, file size) with Playwright-based viewer rendering verification.