Web testing
Browser tests are recorded with Playwright codegen and stored as real scripts you can read and edit. Features group them; suites put them in order.
Features group your scripts
A feature is a container for related scripts — usually one user-facing capability, like checkout or sign-up. Create one before recording.
qaclan web feature create "checkout"qaclan web feature listThe list shows a script count per feature, and flags any feature that has none yet. Deleting a feature that still has scripts asks for confirmation and deletes them too.
Recording a test
qaclan web record --feature <feature_id> --name "place order" --url https://your-app.testPlaywright codegen launches against your start URL, or a blank page if you omit --url. Interact with the application, then close the browser to stop recording. The captured actions are wrapped in a QAClan run harness and saved as a new script under the feature.
Script languages
Pass --language to choose the output. The default suits most people; pick the one your team already reads.
qaclan web record --feature <feature_id> --name login --language typescriptpythonjavascriptjavascript-testtypescript
Recording needs a display
Codegen opens a real browser window. Inside Docker or on a headless server there is nothing to open it on. Record on your host machine, then run the script headless wherever you like.
Skip the parts you do not want recorded
Codegen has a pause control. Use it while you do setup work you do not want in the script — logging in, seeding data — then resume recording for the part you are actually testing.
Hardening a recording
A raw recording is literal: real selectors, your real password in the file, and no waiting. Open the script in the local UI at localhost:7823 and the editor reviews it and offers changes. None of this requires writing Playwright.
Bind values to environment variables
The editor finds hardcoded emails, passwords and URLs and offers to replace them with a variable from an environment. Pick the key, preview the result, apply. Credentials then live in the environment rather than the script — see Environments and secrets.
Add waits that match the page
Where the page loads more slowly than the test runs, the editor adds a wait that pauses only as long as needed. Fast pages are unaffected, so you are not paying a fixed sleep on every run.
Use typed input where typing matters
Search boxes and autocompletes often only react to real keystrokes. Those fields are switched to character-by-character entry so the filtering actually fires during the run.
Managing scripts
| Command | What it does |
|---|---|
qaclan web script list | List scripts, optionally filtered with --feature <feature_id> |
qaclan web script show <script_id> | Print the script file contents |
qaclan web script delete <script_id> | Delete a script and its file; warns if a suite still uses it |
Importing an existing Playwright script
If you already have codegen output, bring it in rather than re-recording. Imported scripts join the same features, suites, runs and reports as anything recorded here.
qaclan web script import ./tests/checkout.spec.ts --name "checkout" --feature <feature_id> --language typescriptRunning them
A single script is not the unit of work — a suite is. Ordering, shared browser state, run flags and reports are covered in Suites, runs and reports.