Natural language testing that feels like describing what you want, not programming
Writing tests with TestDriver is intuitive and straightforward. No more brittle CSS selectors or complex XPath expressions - just describe what you want in plain English.
// ✅ Readable and maintainableawait testdriver.find('submit button').click();await testdriver.find('email input in the login form').type('[email protected]');await testdriver.find('delete button in the top right corner').click();
Natural language selectors are resilient to UI changes. If a button moves or the DOM structure changes, the same description often still works.
Write cleaner, more readable test code with method chaining:
Copy
// Find and interact in one fluid motionawait testdriver.find('Login button').click();await testdriver.find('username field').type('admin');await testdriver.find('password field').type('secret', { secret: true });await testdriver.find('submit').click();// Also works with hover interactionsawait testdriver.find('Products menu').hover();await testdriver.find('Laptops submenu').click();// And other actionsawait testdriver.find('checkbox item').doubleClick();await testdriver.find('context menu item').rightClick();
First-class TypeScript support with complete IntelliSense and type safety:
Copy
import { test } from 'vitest';import { chrome } from 'testdriverai/presets';test('typed test', async (context) => { const { testdriver } = await chrome(context, { url: 'https://example.com' }); const element = await testdriver.find('button'); // ✅ Autocomplete works perfectly element.coordinates.x; element.coordinates.y; element.text; element.confidence; // ❌ TypeScript catches errors at compile time element.invalidProperty; // Error: Property 'invalidProperty' does not exist});
Type Definitions
TestDriver includes comprehensive TypeScript definitions for all APIs, methods, and return types. Your IDE will provide intelligent autocomplete and inline documentation.