Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Locate elements and verify app state with AI-powered assertions
.claude/skills/testdriverai-testdriver-making-assertions/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-03 | ✗→✓ | ▲ Improved | -30% | 0% |
| case-04 | ✗→✓ | ▲ Improved | -65% | 0% |
| case-06 | ✗→✓ | ▲ Improved | -17% | 0% |
| case-13 | ✗→✓ | ▲ Improved | -46% | 0% |
| case-15 | ✗→✓ | ▲ Improved | 1% | 0% |
<!-- Generated from making-assertions.mdx. DO NOT EDIT. -->
Once a test runs, validate that the app did what it should. Validation has two parts: locating the elements you want to check, and making assertions about the state of your app. TestDriver uses AI as a judge, returning a boolean plus reasoning about whether your app is in the expected state.
Use natural language to describe elements. Descriptions should be specific enough to locate the element, but not too-specific that they break with minor UI changes. For example:
javascriptawait testdriver.find('email input field'); await testdriver.find('first product card in the grid'); await testdriver.find('dropdown menu labeled "Country"');
<Info>TestDriver will cache found elements for improved performance on subsequent calls. Learn more about element caching here.</Info>
After finding an element, you can inspect its properties for debugging:
javascriptconst button = await testdriver.find('submit button'); console.log(button);
This outputs all element properties:
javascript{ description: 'submit button', found: true, x: 150, y: 300, coordinates: { x: 150, y: 300, centerX: 200, centerY: 320 }, threshold: 0.8, confidence: 0.95, similarity: 0.92, selector: 'button[type="submit"]', cache: { hit: true, strategy: 'pixel-diff', createdAt: '2025-01-15T10:30:00Z', diffPercent: 0.02, imageUrl: 'https://...' } }
Find and interact with multiple elements:
javascript// Find all matching elements const products = await testdriver.findAll('product card'); console.log(`Found ${products.length} products`); // Interact with each for (const product of products) { const title = await product.find('title text'); console.log('Product:', title.text); await product.find('add to cart button').click(); } // Or find specific element const firstProduct = products[0]; await firstProduct.click();
Use AI-powered assertions to verify application state. TestDriver acts as a judge: it evaluates your natural-language statement against the current state of the app and returns a boolean plus reasoning explaining the verdict.
javascript// Verify visibility await testdriver.assert('login page is displayed'); await testdriver.assert('submit button is visible'); await testdriver.assert('loading spinner is not visible'); // Verify content await testdriver.assert('page title is "Welcome"'); await testdriver.assert('success message says "Account created"'); await testdriver.assert('error message contains "Invalid email"'); // Verify state await testdriver.assert('checkbox is checked'); await testdriver.assert('dropdown shows "United States"'); await testdriver.assert('button is disabled'); // Verify visual appearance await testdriver.assert('submit button is blue'); await testdriver.assert('form has red border');
<Info>Assertions are not cached and always re-evaluated to ensure accuracy.</Info>
<Card title="Adapt" icon="arrows-rotate" href="/performing-actions"> Drive your app forward by performing actions on the elements you've located and validated. </Card>
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-12 | pass→pass | 4,935 | 1,988 | -60% | 1 | 1 | 0% | 809 | 559 | -31% | 0 | 0 | — |
case-01 | pass→pass | 3,827 | 5,874 | +53% | 1 | 1 | 0% | 617 | 572 | -7% | 0 | 0 | — |
case-02 | pass→pass | 10,205 | 3,143 | -69% | 1 | 1 | 0% | 1,646 | 610 | -63% | 0 | 0 | — |
case-03 | fail→pass | 4,219 | 1,854 | -56% | 1 | 1 | 0% | 667 | 469 | -30% | 0 | 0 | — |
case-04 | fail→pass | 9,187 | 2,082 | -77% | 1 | 1 | 0% | 1,470 | 517 | -65% | 0 | 0 | — |
case-05 | pass→pass | 9,455 | 2,011 | -79% | 1 | 1 | 0% | 1,526 | 510 | -67% | 0 | 0 | — |
case-06 | fail→pass | 3,960 | 2,116 | -47% | 1 | 1 | 0% | 643 | 531 | -17% | 0 | 0 | — |
case-07 | pass→pass | 11,328 | 1,944 | -83% | 1 | 1 | 0% | 1,887 | 507 | -73% | 0 | 0 | — |
case-08 | pass→pass | 5,830 | 2,144 | -63% | 1 | 1 | 0% | 876 | 533 | -39% | 0 | 0 | — |
case-09 | pass→pass | 10,101 | 1,553 | -85% | 1 | 1 | 0% | 1,704 | 479 | -72% | 0 | 0 | — |
case-10 | pass→pass | 6,329 | 2,231 | -65% | 1 | 1 | 0% | 948 | 566 | -40% | 0 | 0 | — |
case-11 | pass→pass | 3,781 | 1,759 | -53% | 1 | 1 | 0% | 548 | 462 | -16% | 0 | 0 | — |
case-13 | fail→pass | 7,115 | 2,755 | -61% | 1 | 1 | 0% | 1,142 | 622 | -46% | 0 | 0 | — |
case-14 | pass→pass | 4,804 | 1,676 | -65% | 1 | 1 | 0% | 649 | 501 | -23% | 0 | 0 | — |
case-15 | fail→pass | 2,933 | 1,524 | -48% | 1 | 1 | 0% | 441 | 446 | +1% | 0 | 0 | — |
case-16 | pass→pass | 4,611 | 1,838 | -60% | 1 | 1 | 0% | 675 | 507 | -25% | 0 | 0 | — |
case-17 | pass→pass | 3,919 | 2,163 | -45% | 1 | 1 | 0% | 655 | 551 | -16% | 0 | 0 | — |
case-18 | pass→pass | 5,152 | 2,074 | -60% | 1 | 1 | 0% | 780 | 568 | -27% | 0 | 0 | — |
case-19 | pass→pass | 4,021 | 1,531 | -62% | 1 | 1 | 0% | 624 | 426 | -32% | 0 | 0 | — |
case-20 | fail→pass | 3,848 | 2,114 | -45% | 1 | 1 | 0% | 542 | 548 | +1% | 0 | 0 | — |
case-21 | pass→pass | 4,227 | 2,789 | -34% | 1 | 1 | 0% | 602 | 650 | +8% | 0 | 0 | — |
case-22 | pass→pass | 2,724 | 1,835 | -33% | 1 | 1 | 0% | 465 | 505 | +9% | 0 | 0 | — |
case-23 | pass→pass | 3,364 | 4,525 | +35% | 1 | 1 | 0% | 506 | 1,013 | +100% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +26 percentage points is the difference between those two pass rates over the 23 comparable cases.
The publisher has shipped newer versions since this run, so these numbers describe v2, not the version currently listed.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.