The “Download Test” action exports a Decipher test as a self-containedDocumentation Index
Fetch the complete documentation index at: https://docs.getdecipher.com/llms.txt
Use this file to discover all available pages before exploring further.
@playwright/test spec file. The generated .spec.js is fully deterministic — no AI calls at runtime — and runs against a real browser using selectors mined from the test’s most recent passed runs (with the recorded selectors as fallback). Useful for CI pipelines that need a static script, debugging selector flake locally, or running a test outside Decipher entirely.
What’s included
Selectors come from the latest 3 passed runs in the last 2 days (strict per-step intersection), falling back to the recorded selectors stored on the test. Login steps are inlined as raw Playwright actions with credentials substituted from your identity row. The script ships with a 1920×1080 viewport.What’s skipped
Steps that need the Decipher runtime or AI to behave correctly are emitted as// SKIPPED: comments: assert, code, tab-switch, and upload.
Step 1: Download the spec
Step 2: Set up a Playwright environment
If you already have a directory with
@playwright/test installed, drop the spec there and skip straight to Step 3 — the rest of this section is only for first-time setup.~/playwright-runs/):
playwright.config.ts — the generated spec sets its own viewport via test.use({ viewport: { width: 1920, height: 1080 } }) and disables Playwright’s per-test timeout via test.setTimeout(0).
Step 3: Run the spec
Move (or download) the.spec.js file into the directory you set up in Step 2, then:
--headed to either invocation to run with a visible browser window — useful for watching the test execute or debugging timing issues. Without it, Playwright runs Chromium headlessly.
The script logs every step’s start, picked selector, click strategy, and elapsed time to your terminal. Failed steps print the underlying error and abort the test.
What you’ll see in the terminal
Where Playwright Test puts artifacts
The runner (not the generated script) creates these files in the directory you rannpx playwright test from:
| File / Folder | What it is |
|---|---|
test-results/ | Per-failure artifacts: error context, screenshots, traces. Created on failure only. |
.last-run.json | Metadata about the most recent run. Powers npx playwright test --last-failed. |
playwright-report/ | HTML report (only if you opt in via --reporter=html). |
test-results/, playwright-report/, and .last-run.json to your .gitignore if you commit your specs.
Common questions
Can I run this with `node script.spec.js` directly?
Can I run this with `node script.spec.js` directly?
No — the spec uses
@playwright/test’s test()/expect() framework, so it must be run via npx playwright test. If you want a plain Node script you’d need the playwright runtime package and a different generator (not currently exposed).Does it use AI or call Decipher at runtime?
Does it use AI or call Decipher at runtime?
No. The script only requires
@playwright/test and a Chromium binary. Once downloaded, it has no Decipher dependencies and works fully offline.Does it work for tests with login steps?
Does it work for tests with login steps?
Yes, but only when the login uses a credential identity (username + password stored in Decipher). The generator decrypts the password and inlines the recorded login Playwright steps with
{{username}} / {{password}} substituted in place. Manual identities are skipped because they go through the Decipher CUA agent at runtime.Why are some steps marked SKIPPED in the output?
Why are some steps marked SKIPPED in the output?
The deterministic generator can only emit step types whose action is fully described by the stored selectors. Steps that need the Decipher runtime (assertions, code-block execution, tab-switching by AI judgement, file uploads, etc.) are emitted as comments so the script structure still mirrors your test, but no action is taken.
The test fails — what should I check first?
The test fails — what should I check first?
The terminal log pinpoints which step failed and why. Three common categories:
no candidate selector found— every cached selector returned zero matches. Usually means the previous step didn’t reach the expected page state (modal didn’t open, navigation didn’t happen).locator.click failed (intercept/Timeout)— the script auto-escalates throughpage.mouse.clickat the element’s center, then a synthetic event dispatch. If all three fail the click target is genuinely unreachable.tiebreak (location): … → nth(N)— the cached selector matched multiple visible elements; the script picks the one whose center is closest to the originally-recorded action area. If the wrong element was picked, the test was likely recorded against a layout the page no longer matches.