@asserthive/[email protected] is published under npm's beta tag. Use the documented exact version for this beta; the latest tag may point to an older beta.
Getting started
Install the published beta
These instructions target the published @asserthive/[email protected] beta. Use Node.js 18 or newer and npm. Start in a fresh project; source repository access is not required.
mkdir webtest-ai-trial && cd webtest-ai-trial
npm init -y
npm install --save-dev --save-exact @asserthive/[email protected]
npx playwright install chromium
npx webtest-ai --version
After installation, npx webtest-ai resolves the local CLI and should report 0.2.0-beta.1. Pin the exact package version for reproducibility; @beta is a moving prerelease tag. See the isolated beta trial for public-site checks and validation history.
Try the demo
npx webtest-ai demo
This runs twelve Markdown goals against the bundled Everyday Goods shop in isolated browser contexts. The default mode uses deterministic navigator and selector fixtures. It verifies the runtime and reports; it does not measure live model capability.
For an external agent such as a Codex session:
npx webtest-ai demo session headed
The command prints a control-file path. The external agent reads each fresh request and supplies an action through the packaged demo-site/sessionControl.js helper. See the session workflow for the complete instructions. There is no automatic navigator fallback.
For Ollama or a hosted model, see live model testing.
Write a goal
Create specs/homepage.md:
---
suite: homepage
baseUrl: https://example.com
tags: [smoke]
---
# Homepage loads
## Goal
Open the homepage and check its heading.
## Success
- Text: Example Domain
Goal tests require a model config with agent.profile. Copy one of the packaged examples/config/goal-agent*.json templates into your project and configure the endpoint and model. Store keys in environment variables named by apiKeyEnv.
npx webtest-ai run --suite specs/homepage.md --config webtest-ai.config.json
For an exact test without a model, replace the Goal and Success sections with:
## Steps
1. Open "/"
## Expected
1. Assert text "Example Domain"
Both forms use the bounded engine. Explicit browser assertions decide the result.
Review results
Reports are written under artifacts/reports/; per-test screenshots and observations live under artifacts/<runId>/<testId>/.
- HTML: verdicts, action screenshots, model identities, usage, cost status, accessibility findings, and lab LCP/CLS.
- Agent JSON: structured results and quality statuses for agent workflows and CI.
- Calls NDJSON: one record per tool or model call.
See Markdown goals, demo modes, and the migration guide.
See limits, multi-page journeys, and login reuse before configuring longer authenticated flows.