Skip to content
Testing
Skill

/testdriver-quickstart-manual

Add TestDriver to an existing project by hand.

From plugin
testdriverai
35665 skills1 agent

Claude Code

$ npx -y skills add testdriverai/testdriverai --skill testdriver-quickstart-manual --agent claude-code

SKILL.md

testdriver-quickstart-manual.SKILL.md
name: testdriver:quickstart-manual
description: Add TestDriver to an existing project by hand.

<!-- Generated from quickstart-manual.mdx. DO NOT EDIT. -->

Add TestDriver to an existing project without the `init` scaffold. This is useful when you already have a Vitest setup or want full control over each file.

<Tip> If you are starting from scratch, the [CLI quickstart](/quickstart-cli) does all of this for you with one command. </Tip>

<Steps> <Step title="Get an API key">

<Card title="Get an API Key" icon="user-plus" href="https://console.testdriver.ai/settings" arrow horizontal > Start with 60 free device minutes, no credit card required. </Card>

Save the key in a `.env` file at your project root. The SDK loads it automatically:

    TD_API_KEY=your_api_key

Add `.env` to `.gitignore` so the key is not committed.

</Step> <Step title="Install dependencies">

Install Vitest and TestDriver as dev dependencies:

    npm install --save-dev vitest testdriverai

<Note> TestDriver requires Node.js 20.19 or later and only runs on [Vitest](https://vitest.dev). Jest, Mocha, and other runners are not supported. </Note>

</Step> <Step title="Configure Vitest">

Create `vitest.config.js` at your project root (or add these settings to an existing one):

    import { defineConfig } from 'vitest/config';
    import TestDriver from 'testdriverai/vitest';

    export default defineConfig({
      test: {
        // Sandboxes take time to boot and tear down. Both values are required.
        testTimeout: 300000,
        hookTimeout: 300000,
        reporters: ['default', TestDriver()],
        setupFiles: ['testdriverai/vitest/setup'],
      },
    });
  • `TestDriver()` reporter uploads results, recordings, and screenshots to the console.
  • `setupFiles` registers the hooks that connect each test to a sandbox and clean it up.
  • Without `hookTimeout`, cleanup fails at Vitest's default 10-second limit.

</Step> <Step title="Write a test">

Create `tests/search.test.js`:

    import { test, expect } from 'vitest';
    import { TestDriver } from 'testdriverai/vitest/hooks';

    test('search shows results', async (context) => {
      // Connects to a sandbox and records the session
      const testdriver = TestDriver(context);

      // Launch Chrome at a URL
      await testdriver.provision.chrome({ url: 'https://duckduckgo.com' });

      // Locate elements by describing them
      const searchBox = await testdriver.find('search input field');
      await searchBox.click();

      // Type into the focused element and submit
      await testdriver.type('testdriver.ai');
      await testdriver.pressKeys(['enter']);

      // Ask a yes/no question about the screen
      const result = await testdriver.assert('search results are displayed');
      expect(result).toBeTruthy();
    });

If your project does not have `"type": "module"` in `package.json`, name the file `search.test.mjs` instead.

</Step> <Step title="Run the test">

    npx vitest run

A sandbox starts, Chrome opens, and a live preview appears in your browser. When the run finishes, open the `TESTDRIVER_RUN_URL` printed at the end of the output to see the recording and step-by-step screenshots.

</Step> </Steps>

Optional: AI client setup

If you want to write tests with an AI assistant, connect the TestDriver agent and MCP server. You can do this without re-scaffolding the project:

npx testdriverai init --client cursor,claude-code,vscode --no-sample-test

See [Configure Your Agent](/quickstart-cli#connect-your-ai-client) for the manual configuration of each client.

Next steps

<CardGroup cols={2}> <Card title="Walkthrough" icon="map" href="/provision" arrow horizontal> Provision apps, locate elements, perform actions, and make assertions. </Card> <Card title="CI/CD" icon="github" href="/ci-cd" arrow horizontal> Run tests on every pull request with GitHub Actions or another provider. </Card> </CardGroup>

Read more
@testdriverai
Ships withtestdriverai

Computer-Use SDK for E2E QA Testing

35665 skills1 agent
Get the whole plugin

Stars on GitHub

Momentum

stars in total
356
Star history of testdriverai/testdriverai on GitHub, a chart by star-history.com

Other skills on testdriverai.

More skills from other plugins.

api-review

api-review

Produce the "Playwright 1.xx API Review" artifact for a range of commits - the public API additions and the breaking or behavior…

@microsoft@microsoftInstall Skill
add-e2e-selectors

add-e2e-selectors

Add reliable @grafana/e2e-selectors to interactive elements and key containers in the Grafana frontend. Use when adding e2e…

grafana5d78k
@grafana@grafanaInstall Skill
promptfoo-evals

promptfoo-evals

Write, refine, run, and QA promptfoo evaluation suites: promptfooconfig.yaml, prompts, providers, vars, tests, assertions,…

promptfoo13d27k
@promptfoo@promptfooInstall Skill
deepeval

deepeval

DeepEval evaluation workflow for AI agents and LLM applications. TRIGGER when the user wants to evaluate or improve an AI agent,…

@confident-ai@confident-aiInstall Skill

Questions about testdriver-quickstart-manual.

Which coding agents can use testdriver-quickstart-manual?
testdriver-quickstart-manual installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.