decipher-qa test run-cdp connects to a Chrome DevTools Protocol (CDP) endpoint — either a Chromium instance it launches for you via decipher-browser, or an external browser you point it at.
Prerequisites:
- Node.js 18 or later
- A Decipher account with at least one recorded test
- The numeric test ID you want to run (visible in the URL on the test’s page)
Step 1: Install the CLIs
You’ll need two packages — thedecipher-qa CLI and the decipher-browser launcher. Install both globally:
Step 2: Authenticate
Grab your API token
Copy it from app.getdecipher.com/settings?tab=general.
Log in
~/.decipher/qa-config.json — you only need to do this once per machine.Step 3: Run a Test
The simplest invocation launches a headless Chromium, runs the test, and streams progress to your terminal:1522 with your own test ID. The CLI exits 0 on pass and 1 on fail, so it drops straight into CI scripts.
Common flags
--cdp — accepts any ws:// or wss:// CDP endpoint. Launch Chrome with --remote-debugging-port=9222 or use Playwright/Puppeteer to expose one. Omit this flag and the CLI spawns decipher-browser launch for you, reads its CDP URL from stdout, and cleans up on exit.
--origin — redirects your test at a different environment (prod, staging, localhost) without re-recording.
- Rewrites
gotosteps and the identity login URL whose origin matches the test’s primary origin (the firstgotoin the recording). - Path, query, and hash are preserved.
- Third-party hosts (e.g. auth redirects) are left alone.
Sample Output
Each step prints its description, a✓ (or ✗) marker, and the footer gives you a quick pass/fail verdict plus total elapsed wall-clock time.
Example: passing run
Example: passing run
Running Programmatically
Need to call this from a script, test suite, or custom CI runner? Both wrappers spawn the CLI and return a typed{ status, duration, runId, runUrl } result:
- TypeScript Wrapper — for Node scripts, Vitest/Jest suites, or TS-based CI runners.
- Python Wrapper — for Python scripts, pytest suites, or Python-based CI runners.
CLI Reference
decipher-qa test run-cdp
| Flag | Description |
|---|---|
--testId <id> | Required. Positive integer test ID |
--cdp <url> | CDP websocket URL (ws:// or wss://). Omit to auto-launch a local Chromium via decipher-browser |
--headful | Show the local Chromium window. Only applies when --cdp is omitted |
--origin <url> | Override origin for goto steps and the identity login URL whose origin matches the test’s primary origin. Path/query/hash preserved |
--verbose | Print every SSE event and phase (noisy, useful for debugging the agent) |
decipher-browser launch
| Flag | Description |
|---|---|
--headful | Show the Chromium window (default: headless) |
--viewport <WxH> | Viewport size, e.g. 1920x1080 |
Troubleshooting
'decipher-browser: command not found'
'decipher-browser: command not found'
The global install didn’t put the binary on your On macOS/Linux, make sure
PATH. Reinstall globally and confirm your package manager’s global bin directory is on PATH:$(npm root -g)/../bin is in your PATH.Chromium fails to launch / 'executable doesn't exist'
Chromium fails to launch / 'executable doesn't exist'
decipher-browser relies on Playwright’s Chromium download. If the postinstall hook was skipped (common with --ignore-scripts or some CI caches), install it manually:'Not logged in' / 401 errors
'Not logged in' / 401 errors
Your token may be expired or missing. Re-authenticate:Grab a fresh token from app.getdecipher.com/settings?tab=general.
'--cdp must be a ws:// or wss:// URL'
'--cdp must be a ws:// or wss:// URL'
The CLI validates the CDP URL up front. Some browsers expose an
http://localhost:9222/json/version endpoint whose webSocketDebuggerUrl field contains the actual ws:// URL you want to pass in.Test run starts but exits without a runId
Test run starts but exits without a runId
This almost always means the CLI crashed before it could talk to our API. Re-run with
--verbose to see the raw event stream, and double-check that decipher-qa whoami still succeeds.Need help? Contact our support team.