Getting Started

Install

npm install --save-dev @asserthive/webtest-ai@beta
npx playwright install chromium

After the package is installed in your project, npx webtest-ai ... resolves the local webtest-ai binary. For a one-off run without a local install, use npx @asserthive/webtest-ai@beta ....

Create Config

cp webtest-ai.config.example.json webtest-ai.config.json

The config file is optional. Missing config means WebTest AI uses built-in defaults.

Write A Spec

Create a new specs/homepage.md:

mkdir -p specs
---
suite: homepage
baseUrl: https://example.com
tags: [smoke]
---

# Homepage Loads

## Goal

Verify the public homepage loads.

## Steps
1. Open "/"

## Expected
1. Assert text "Example Domain"

Run It

npx webtest-ai run --suite specs/homepage.md

Reports are written under artifacts/reports/; per-test evidence is written under artifacts/<runId>/<testId>/.

Try Intent Mode

Intent mode lets one spec describe the goal while WebTest AI resolves branded or translated controls from bounded page evidence.

---
suite: checkout-intent
modelMode: intent
targets: [northwind-en, maison-fr, mercado-es]
---

# Guest checkout

## Goal
Buy the configured starter plan as a guest.

## Data
email: env WEBTEST_AI_BUYER_EMAIL

## Expected
1. Assert outcome "order is confirmed"

Use exact steps and assertions when copy matters. Use Assert outcome when the outcome is semantic and labels vary across locale, theme, or brand.

Run the V2 demo evidence pack from this repository:

npm run demo:v2
npm run demo:intent -- --headed

The demo serves northwind-en, maison-fr, and mercado-es storefronts and runs the same intent specs across signup, login, search, cart, discount, checkout, support, and preview workflows.

Run The Included Demo

In this repository, you can also run the checked-in demo suite:

npm run demo:site

Then, in another terminal:

npx webtest-ai run --suite specs/webtest-ai-demo.md --tags public