SCREENCAST-MCP / CI
Record test runs in CI
Browser tests get a video of every failure for free. Desktop apps on Windows (Electron, WPF, WinUI, WinForms, games) don't. screencast-mcp record runs your test command while it records the runner's desktop, then turns a failure into a GIF and a contact sheet you can open from the run.
The same tools the MCP server exposes, without an MCP client. The command's exit code passes straight through.
npx -y @tmhs/screencast-mcp record --target full -- npm run test:e2e
--target:full(default),monitor:0,window:exe=MyApp.exe, orregion:x,y,w,h.--artifacts failure|always|never: when to makeevidence.gifandcontact-sheet.png(defaultfailure).--last 30: the GIF covers the last 30 s, where the failure usually is;0keeps it all.--out,--fps,--no-gif,--no-contact-sheet,--discard-on-success,--max-duration.
Everything lands in screencast-evidence/ with an evidence.json summary. Any single tool works the same way: npx -y @tmhs/screencast-mcp call doctor, or call pipeline @recipe.json.
A composite action wraps it for windows-latest: it checks Node, installs ffmpeg if it is missing, records the command, uploads the evidence folder as an artifact, writes a job summary, and then fails the step with the command's exit code.
jobs:
ui-tests:
runs-on: windows-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
with:
node-version: 22
- run: npm ci
- uses: TMHSDigital/screencast-mcp@main # pin a release tag or SHA
with:
command: npm run test:e2e
target: full # or window:exe=MyApp.exe
artifacts: failure # GIF and contact sheet only when it fails
Outputs: exit-code, gif, contact-sheet, recording, and evidence-dir, for a later step that comments on the PR. All inputs are in action.yml.
- Hosted Windows runners have an interactive desktop, so
gdigrabrecords what your app draws. This repo records its own capture smoke test with the action on every change to it. - A recording holds whatever is on screen. Keep secrets off the runner's desktop, and remember artifacts are visible to anyone who can read the run.
- For a longer suite, keep the default
discard-on-successso green runs upload onlyevidence.json.