Home / Market / testdriver e2e testing

testdriver e2e testing

Build E2E tests with TestDriver.ai, the AI code reviewer that runs every pull request in a real desktop sandbox, finds bugs, and builds regression tests

skill★ 507590 dlgithubCC-BY-4.0 content; MIT code; upstream exceptions applyInstall in CosmosUpstream Source

Documentation & Preview

--- name: testdriver-e2e-testing description: "Build E2E tests with TestDriver.ai, the AI code reviewer that runs every pull request in a real desktop sandbox, finds bugs, and builds regression tests" category: testing risk: safe source: community source_repo: testdriverai/testdriverai source_type: official date_added: "2026-09-24" author: testdriverai tags: [testing, e2e, qa, automation, computer-use] tools: [claude, cursor, gemini] license: "Apache-2.0" license_source: "https://github.com/testdriverai/testdriverai/blob/main/LICENSE"

---

TestDriver End-to-End Testing

Overview

TestDriver is an AI code reviewer that actually runs your app. It automatically runs every pull request in a real desktop sandbox, finds bugs, and builds regression tests. Tests control browsers and native applications using natural language element descriptions and AI vision, and run as Vitest suites. This skill teaches an agent how to author, run, and debug TestDriver tests.

When to Use This Skill

How It Works

Step 1: Set up the project

npx testdriverai init

This scaffolds package.json, example tests, vitest.config.mjs, and a GitHub Actions workflow. The user must set TD_API_KEY in .env (get a key at https://console.testdriver.ai/team).

Step 2: Write a test

Tests are Vitest suites using the TestDriver hooks:

import { describe, expect, it } from "vitest";
import { TestDriver } from "testdriverai/vitest/hooks";

describe("Login", () => {
  it("signs in successfully", async (context) => {
    const testdriver = TestDriver(context);
    await testdriver.provision.chrome({ url: "https://example.com/login" });

    const email = await testdriver.find("email input field");
    await email.click();
    await testdriver.type("user@example.com");

    const submit = await testdriver.find("Sign In button");
    await submit.click();

    const result = await testdriver.assert("the dashboard is visible");
    expect(result).toBeTruthy();
  });
});

Step 3: Run and iterate

vitest run tests/login.test.mjs

Screenshots are captured automatically before and after every command and saved to .testdriver/screenshots/, named with the source line number for easy debugging.

Examples

Example 1: Testing a desktop (Electron) app

await testdriver.provision.electron({ appPath: "./dist/my-app" });
const menu = await testdriver.find("File menu in the menu bar");
await menu.click();

Example 2: Waiting for slow elements

const done = await testdriver.find("Loading complete indicator", { timeout: 30000 });
await done.click();

Best Practices

Limitations

Security & Safety Notes

Common Pitfalls

Solution: Set hookTimeout: 900000 in vitest.config.mjs; sandbox teardown and recording uploads take longer than Vitest's default.

Solution: An input field has focus. Press Escape or click the page background first, then scroll.

Related Skills