Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions .dev/skills/authoring-docs/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Readers skim. They read the headings, the first sentence of each section,
the code blocks, and the tables, then leave. Write for that reader. Show the
fast path first and fold everything else.

Model pages: `docs/bug-bash.mdx` and `docs/quickstart.mdx`. When in doubt,
Model pages: `docs/explore.mdx` and `docs/quickstart.mdx`. When in doubt,
copy their shape.

## IMPORTANT: shorten every page
Expand Down Expand Up @@ -57,13 +57,13 @@ of three kinds, and work them in this order.

Keep a guarantee the reader would otherwise doubt, even when it reads
like "works as it does locally". Check whether another page says it can
fail. `browser.mdx` says a provider without `downloads` fails, so a
fail. `reference/web.mdx` says a provider without `downloads` fails, so a
provider page keeps the line that downloads work.
2. **Merge what's said twice.** Each fact has one place.
- A lede paragraph that previews a section becomes a link to it.
- A "Before you start" whose items fit in two short sentences becomes a
`Note` in the first task. Keep the section when its items need
bullets, as in `docs/bug-bash.mdx`.
bullets, as in `docs/explore.mdx`.
- A section that explains one option moves under the config that sets
it.
- A list and a table that describe the same fields become one table,
Expand Down Expand Up @@ -181,7 +181,8 @@ description: <one sentence: what the reader can do after this page>

## Vendor logos

The sidebar shows no icons. Don't set `icon:` in a page's frontmatter;
The sidebar shows an icon on each group (`icon` on the group in
`docs/docs.json`), never on a page. Don't set `icon:` in a page's frontmatter;
`pnpm docs:check` fails on one.

**A vendor page gets the vendor's logo on its cards.** A vendor page is
Expand Down Expand Up @@ -457,8 +458,9 @@ Each group opens with one table, one row per entry. Keep it to the minimum:
- A short example. Show a default as a code comment: `// default: 5000`.
- Accepted values as a list or a table. Errors as a `| Throws | When |` table.
- At most one `<Note>`. `<Warning>` only for data loss or a leaked secret.
- TypeScript declarations keep their JSDoc, in the entry or under
`## Types`. They are the contract.
- TypeScript declarations show signatures and types only, with no JSDoc,
in the entry or under `## Types`. A default, limit, unit, or error goes in
the entry's prose or tables, stated once.
- No Version History section; nothing reliable feeds it.

### Keep every fact
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ runs your suite. The server needs no model.
}
```

See the [MCP server docs](https://e2e.com/docs/mcp-server) for setup and
See the [MCP server docs](https://e2e.com/docs/coding-agents#let-the-agent-use-the-app) for setup and
every tool.

## Packages
Expand Down
41 changes: 40 additions & 1 deletion docs/agent-steps.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: How agent steps work
description: What the model sees, what it may do, how a step ends, and what it costs.
description: "Learn how an agent step runs in e2e, from what the AI model sees and which actions it may take to how a step ends and what it costs in model calls."
"og:image": "https://e2e.com/docs/images/og/agent-steps.png?v=321767dc3b"
"twitter:image": "https://e2e.com/docs/images/og/agent-steps.png?v=321767dc3b"
---
Expand Down Expand Up @@ -126,6 +126,45 @@ Use `expect` for exact checks, and give each `act` the
steps toward one [goal](/core-concepts#goals). When the provider caches prompts,
`--debug` shows the cached share of input tokens per step.

## Split a long flow into goals

Start with one `agent.act` call for the behavior under test. Split it at a
meaningful transition when the next step needs a known state (such as the
payment page of a long checkout), when a long flow risks the `maxSteps` or
`maxModelCalls` budgets, or when a failure in the middle needs its own step
boundary. Say why the split is needed, and wait for the intermediate screen
state before you continue. Each call has its own
[budgets](/reference/agent#budgets) and can replay from its own recording.

```ts title="Complete one checkout across two screens"
import { expect, test } from 'e2e';

test('places an order with a saved card', async ({ app, agent, screen }) => {
Comment thread
okwasniewski marked this conversation as resolved.
Resolved
await app.open('/checkout');

// The saved card can load after the Payment heading appears.
await agent.act('Fill the Shipping address with {address}, then choose Continue to payment.', {
params: { address: '12 Market Street' },
});
await screen.getByRole('radio', 'Test card').waitFor();
await agent.act('Select the saved Test card and choose Place order.');

await expect(screen.getByText('Order confirmed')).toBeVisible();
});
```

- **Wait after setup, assert at the end.** When setup uses `agent.act`, end
setup with a wait for the starting state, and check the final outcome in
the assert block. A later passing verification check, such as a locator
assertion or `locator.waitFor()`, confirms earlier goals for the
[replay cache](/cache#when-a-recording-is-written). An `expect` on a plain
value and `expect.poll` do not.
- **Match the UI's wording.** Use the field and button names shown on
screen, and say the order when it matters, such as filling shipping info,
picking a delivery option, then placing the order.
- **When a goal fails, tighten the instruction.** Terms that every goal
shares go into the agent's [`context`](/agents) instead.

## Next

<CardGroup cols={2}>
Expand Down
125 changes: 0 additions & 125 deletions docs/agentic-vs-deterministic.mdx

This file was deleted.

2 changes: 1 addition & 1 deletion docs/agents.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Agents and personas
description: Configure several agents in one suite, pin tests to them, and run one flow as each persona.
description: "Configure several named AI agents in one suite, each with its own model, instructions, and tools, pin tests to them, and run one flow as different personas."
"og:image": "https://e2e.com/docs/images/og/agents.png?v=94dc88725f"
"twitter:image": "https://e2e.com/docs/images/og/agents.png?v=94dc88725f"
---
Expand Down
3 changes: 2 additions & 1 deletion docs/api-testing.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
title: API
description: Check your API with the request fixture and value matchers, in the same files and run as UI tests.
description: "Test HTTP APIs with the request fixture and value matchers, in the same files, run, and report as your UI tests, with no model calls."
"og:image": "https://e2e.com/docs/images/og/api-testing.png?v=bd427bf4fd"
"twitter:image": "https://e2e.com/docs/images/og/api-testing.png?v=bd427bf4fd"
keywords: [HTTP, REST, request]
---

API tests use the [`request`](/reference/request) fixture and value matchers
Expand Down
3 changes: 2 additions & 1 deletion docs/authentication.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
title: Authentication
description: Sign in once, reuse the session across tests, and pass secrets without exposing them to the model.
description: "Sign in once in a setup test, reuse the saved session across tests, and pass passwords and other secrets without exposing them to the AI model."
"og:image": "https://e2e.com/docs/images/og/authentication.png?v=6e061842b8"
"twitter:image": "https://e2e.com/docs/images/og/authentication.png?v=6e061842b8"
keywords: [login, sign in, password, secrets, session]
---

import { Video } from './snippets/video.jsx';
Expand Down
Loading
Loading