Record e2e gif

From lablup/backend.ai-webui · View interactive version

Record e2e gif is an AI agent skill from the GitHub repository lablup/backend.ai-webui. Record Playwright e2e tests as one GIF per test case (video → ffmpeg palette GIF) and return a markdown table for a PR description. Use when the user wants e2e runs recorded as GIFs or attached to a PR.

How to use this skill

Skill file

record-e2e-gif Skill

Record Playwright e2e tests as GIF animations, one GIF per test case.

Prerequisites

How It Works

  1. Run specified Playwright tests with --video=on (Playwright saves .webm per test in test-results/)
  2. For each .webm file, convert to .gif using ffmpeg with palette optimization
  3. Save GIFs to e2e/recordings/{spec-name}/ directory
  4. Return a map of test name → GIF file path

Usage

When invoked, ask for or accept:

Recording Command

pnpm exec playwright test {testFile} --grep "{grep}" --project={project} \
  --video=on --reporter=list 2>&1

Videos are saved to test-results/*/video.webm (one directory per test).

Conversion Command (per video)

ffmpeg -y \
  -i "{input.webm}" \
  -vf "fps=8,scale=960:-1:flags=lanczos,split[s0][s1];[s0]palettegen=max_colors=128[p];[s1][p]paletteuse=dither=bayer" \
  -loop 0 \
  "{output.gif}"

Finding Test Name from Directory

Playwright names test result directories as:

{spec-dir}-{describe-name}-{test-name}-{project}/

Parse the directory name to derive a slug for the GIF filename:

Uploading GIFs to GitHub PR

GIFs stay out of git (e2e/recordings/ is in .gitignore). Attach them with

gh pr edit --attach, following Steps 5-6 of .claude/agents/playwright-e2e-pr-updater.md:

the table goes in the PR body, and each reference is the same path you pass to --attach.

Those steps assume the default outputDir.

If ffmpeg is unavailable, attach the videos instead of GIFs. Run

mkdir -p e2e/recordings and copy each test-results/{dir}/video.webm to

e2e/recordings/{slug}.webm first, since every recording has the same basename. ![name](e2e/recordings/{slug}.webm) plays as a video, also inside a

table cell.

Output Format

Return a markdown table suitable for embedding in a PR description. Before the upload it

holds the local paths. After the upload, return the table from the saved PR body, since the

local paths render nowhere else:

| Test | Recording |
|------|-----------|
| Admin can see the BAIPropertyFilter | ![Admin can see the BAIPropertyFilter](https://github.com/user-attachments/assets/{uuid}) |
| Admin can filter by name | ![Admin can filter by name](https://github.com/user-attachments/assets/{uuid}) |
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.