@fluxwise/replay
v0.1.0
Published
Thin CDP runner for Argan replay scripts — reproduce recorded QA findings in CI with trusted browser input. No Playwright.
Readme
@fluxwise/replay
Runs Argan replay scripts — the YAML files Argan generates from a recorded QA session for each critical/high finding — against a real Chrome over the DevTools Protocol. No Playwright, no model at runtime: the script is plain data and the runner is ~300 lines of CDP.
npx @fluxwise/replay run checkout-cvv-bug.yml --url https://staging.example.com
npx @fluxwise/replay run scripts/*.yml --reporter junit --out test-results.xml
npx @fluxwise/replay check scripts/*.ymlExit code is 0 when every assertion passes, 1 otherwise. Screenshots land in
argan-replay-out/ (override with --out-dir). --url rewrites the origin of
every navigate step so one script can target staging or production.
Rungs
Every step may carry rung: 1|2|3; --rung N raises the floor for a whole run.
| Rung | Click | Type | When |
| ---- | ----- | ---- | ---- |
| 1 (default) | element.click() via Runtime.evaluate | Input.insertText | First-party apps — fastest |
| 2 | Input.dispatchMouseEvent move → press → release (isTrusted: true) | Input.dispatchKeyEvent per character | Bugs that only show on real input |
| 3 | Rung 2 plus an eased, jittered mouse path with dwell and overshoot | Rung 2 with variable delay | Third-party widgets, timing-sensitive flows |
Script format
# argan-replay: checkout-cvv-bug
# Generated from session 01K…
# Finding: CVV field unresponsive (critical)
- navigate: https://app.example.com/checkout
- wait: selector="#payment-form"
- click: "#guest-checkout"
- type: { selector: "#cvv", text: "123", speed: 50 }
- press: Tab
- select: { selector: "#country", value: GB }
- screenshot: before-submit.png
- assert:
console: { level: error, contains: cvv }
network: { has_request: /api/validate-payment, status: 400 }
dom: { selector: "#cvv", has_value: "" }
screenshot: cvv-state.png
- verify_dom: { selector: "#error", visible: true, contains_text: "CVV" }
- mark: bug-reproducedSteps: navigate, wait (selector or ms), click (selector or {x, y}),
type, press, select, screenshot, assert, verify_dom, mark. Any step
accepts timeout (ms, default 10000). An assertion failure is recorded and the
script continues; an action that cannot be performed stops the script and the
remaining steps are reported as skipped.
Scripts may also be written as { meta: {...}, steps: [...] }.
Programmatic use
import { runFiles } from '@fluxwise/replay';
const runs = await runFiles(['cvv.yml'], { baseUrl: 'https://staging.example.com' });Chrome is found automatically on macOS, Linux and Windows; set CHROME_PATH
or pass --chrome otherwise.
