# Recipes

Source: https://webagent-docs-staging.lookover.ai/qa-testing/recipes

> Copy-paste prompts for login, signup, checkout, form validation and link checks.

Paste these into Claude Code or Codex after you have [connected webagent](/qa-testing) and added the [agent setup snippet](/qa-testing/agent-setup). Change the URLs and test data to your own.

## Try it safely first [#try-it-safely-first]

The **Test Arena** at `https://webagent-test-web.pages.dev` is a fake site made for testing. It has a sign-in, a profile form, a contact form, a pricing page and some hard pages. It has no real accounts and no backend, so nothing you do there matters.

The sign-in accepts any valid email and the password `arena-pass`. Use it to check that your setup works before you point the agent at your own app.

> **Warning: Use test data on your own app**
>
> Goals and steps are stored with the run. Give the agent a throwaway test account and test cards only. Never give it a real person's password or card.

## How the recipes work [#how-the-recipes-work]

Each recipe asks the agent to call `smoke_test`. The call has a `url`, plain-language `steps`, and what must be true afterwards: `expectText` (text that must be on the page), `expectUrl` (text the address must contain) and `expectNoText` (text that must not be on the page). The test passes only when every step and every expectation holds. It also checks the console, failed network calls and the links of the start page. The agent gives you the verdict and the report link. See [Reading results](/qa-testing/reading-results).

The prompts name the checks in words. Your agent turns them into the tool arguments.

## Login [#login]

**Works on the Test Arena** (run through Claude Code against the local stack). Two tests, one for each outcome:

```text
Use the webagent smoke_test tool on https://webagent-test-web.pages.dev/app/login.
Steps: type qa@example.com into the Email field, type nope into the Password field,
click Sign in. The text "Wrong email or password." must be on the page.
```

```text
Use the webagent smoke_test tool on https://webagent-test-web.pages.dev/app/login.
Steps: type qa@example.com into the Email field, type arena-pass into the Password
field, click Sign in, wait for the text Welcome. The text "Welcome" must be on the
page and the text "Wrong email or password." must not be on the page.
```

Give me the verdict, the failed steps and the report link for each.

> **Note: Write each step as one plain action**
>
> Put the value next to the field: `type arena-pass into the Password field`. A step like `type the password arena-pass` can be read as typing those words, and the sign-in then fails. Sign-in on the Test Arena takes a moment, so end a sign-in with `wait for the text Welcome`, the same way you would wait for the next screen in your own app. When a step comes while the page is still loading, the browser agent waits and looks again (up to 3 times, about 8 seconds). A click or typing step it is still unsure about after that stops with `low_confidence`.

**For your app:**

```text
Use the webagent smoke_test tool on <STAGING_URL>/login. Steps: type <TEST_EMAIL>
into the email field, type <TEST_PASSWORD> into the password field, click Sign in,
wait for the text <WHAT_YOU_EXPECT, e.g. the user's name>. The address must contain
<WHAT_YOU_EXPECT, e.g. /dashboard>, the text <WHAT_YOU_EXPECT, e.g. the user's name>
must be on the page, and the text "Invalid password" must not be. Give me the verdict, the failed steps, the console
errors and the failed network calls.
```

The text of the steps is stored with the run, so use a throwaway test account for `<TEST_PASSWORD>`.

## Signup [#signup]

This is a template for your own app. The Test Arena has no signup page, so it has not been run against it.

```text
Use the webagent smoke_test tool on <STAGING_URL>/signup. Steps: type
qa+<TODAY>@<YOUR_TEST_DOMAIN> into the email field, type <TEST_PASSWORD> into the
password field, click the sign-up button. The text <WHAT_YOU_EXPECT, e.g. "Check
your email"> must be on the page. Do not try to open a mailbox. Give me the verdict
and the failed steps.
```

Use a new email address for each run, because most apps refuse a second signup with the same address. If your signup needs an email code, a test cannot read the mailbox. End the test at the "code sent" screen, or use a staging switch that skips the code.

## Checkout [#checkout]

This is a template for your own app. The Test Arena has no shop, so it has not been run against it.

```text
Use the webagent smoke_test tool on <STAGING_URL>/login to smoke test the checkout.
Steps: sign in as <TEST_EMAIL> with <TEST_PASSWORD>, open the first product in the
catalogue, add it to the cart, open the cart, check out with the test card
4242 4242 4242 4242 with any future expiry and any CVC. The address must contain
/order, the text "Order confirmed" must be on the page, and the text "Payment
failed" must not be. Do not place the order if the card form asks for a real card.
Give me the verdict, the failed steps and the report link.
```

The card number above is the standard test card of the payment provider Stripe. Use the test card your own payment provider documents. Never use a real card. A test takes at most 30 steps. A longer flow is better as two tests, or as one `run_task` per stage on one browser: see the [agent setup snippet](/qa-testing/agent-setup).

## Form validation [#form-validation]

**Works on the Test Arena** (the profile form needs a sign-in first). One test per message:

```text
Use the webagent smoke_test tool on https://webagent-test-web.pages.dev/app/login.
Steps: type qa@example.com into the Email field, type arena-pass into the Password
field, click Sign in, wait for the text Welcome, open the Profile page, clear the
Name field, click Save. The text "Name is required." must be on the page.
```

```text
Use the webagent smoke_test tool on https://webagent-test-web.pages.dev/app/login.
Steps: type qa@example.com into the Email field, type arena-pass into the Password
field, click Sign in, wait for the text Welcome, open the Profile page, type Priya QA
into the Name field, type a short text into the Bio field, click Save. The text
"Profile saved." must be on the page.
```

The contact form on `https://webagent-test-web.pages.dev/about/` works the same way: an empty submit says `Please fill in: name, email, message.`, a bad email says `Please enter a valid email.`, and a good one shows `Thanks, your message was sent.`

**For your app:** name the field, the bad value and the message you expect, one test per message. A short list of exact messages gives the test something it can compare, so nobody has to guess what "correct" looks like.

## Link check, console errors and accessibility [#link-check-console-errors-and-accessibility]

Every `smoke_test` already does this. It loads the page, checks same-site links on the start page, reports console errors and failed network calls, and checks basic accessibility. With no steps it is a plain health check:

```text
Use the webagent smoke_test tool on https://webagent-test-web.pages.dev/.
Tell me the verdict, how many links were checked and how many are broken, the
console errors, the failed network calls, the accessibility findings, and give me
the report link.
```

A broken link fails the test by default. To report it as a finding only, ask for `strictLinks: false`. To check more or fewer links, ask for `maxLinks` (0 to 200, default 50).

For a whole site, not just the start page, use the `site-audit` skill. See [Skills](/concepts/skills).

`smoke_test` waits up to 60 seconds. If the verdict is `running`, the agent calls `get_report` with the `id`. The report links are short-lived, so open them right away.

## Explore with a goal [#explore-with-a-goal]

When there is nothing to assert yet, give the agent a goal. It uses `run_task`:

```text
Use the webagent run_task tool on https://webagent-test-web.pages.dev/. Open the
Pricing page and tell me what plans it lists.
```

A task checks nothing: `ok` means the agent says it is done. Use it to explore, then turn what you learn into a `smoke_test` with expectations.

## Habits that make prompts work [#habits-that-make-prompts-work]

- Name the URL, the user, the action and the expected result. Give every smoke test an `expectText`, `expectUrl` or `expectNoText`.
- One flow per `smoke_test`. For a task flow, one goal per `run_task`, one browser for the whole flow.
- Ask for the verdict, the failed steps and the report link. Ask for evidence: the session id and the exact error text.
- Say what to do when something is missing: "stop and report", not "try something else".
