Skip to content

[Docs]

xtest documentation

Tell the AI what to test in plain English. It runs the test end to end on the Cloud browser, Chrome on your own computer, an iPhone simulator on a Mac, or an Android emulator on a Mac with macOS 12 or later, or an x64 PC, and saves the steps it took.

[01 · Start here]

Start here

[02 · How a run works]

How a run works

Devices

The Cloud browser runs on our servers, with nothing to install. Through the xtest app the AI also drives the browser on your own Mac or PC, iPhone simulators on a Mac, and Android emulators on a Mac with macOS 12 or later, or an x64 PC. AI control on Windows needs xtest app 0.5 or later.

Saved steps

The first run explores and saves the steps it took. Later runs replay those steps with no AI cost unless a step needs it, and where a step broke the AI takes over from that step.

Watch, take over, stop

Test Lab shows the device as it is now. Answer the questions the AI asks, take the mouse yourself, or stop the run.

It asks before it commits

The server asks you before the AI clicks something that pays, deletes or sends. Saved site logins are encrypted and never reach a transcript.

[03 · What the recorder writes]

What the recorder writes

A test agent writes no code: it saves the steps it took, and later runs replay those steps. Playwright comes from the recorder. Hit record, click through the site yourself and stop, and this is the file it leaves in the editor. A password you type comes out as an environment variable, never as text in the file, and the file checks nothing until you add an expect:

typescript
import { test, expect } from '@playwright/test';

// Credentials are read from the environment, never stored in this file.
// Set each TEST_ variable it reads wherever it runs, such as your CI secrets.

test("Recorded flow - your-site.example", async ({ page }) => {
  await page.goto("https://your-site.example/login");
  await page.getByLabel('Email').fill("user@example.com");
  await page.getByLabel('Password').fill(process.env.TEST_PASSWORD || '');
  await page.getByRole('button', { name: 'Sign in' }).click();

  // Recorded flows assert nothing on their own. Add an expect for what this
  // flow should leave on the page, so the test fails when the flow breaks.
  await expect(page).toHaveURL(/.+/);
});

[04 · Next steps]

Next steps