# Getting Started

## Install

```bash
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

```bash
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`:

```bash
mkdir -p specs
```

```md
---
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

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

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

## Run The Included Demo

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

```bash
npm run demo:site
```

Then, in another terminal:

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