Skip to content
Back to skills

Assertions

ASecurity

Make assertions in TestDriver tests. Use when verifying UI state, checking visual conditions, or validating test outcomes with natural language.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 27, 2026
developmentjavascriptgojavanode

Works with

  • cli

Security analysis

A100/100

Scanned September 27, 2026

npx -y skills add David-Li0406/meta-skill-evloving --skill assertions --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Assertions?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Assertions
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/david-li0406-assertions/badge)](https://www.skillsdirectory.com/skills/david-li0406-assertions)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: assertions
description: Make assertions in TestDriver tests. Use when verifying UI state, checking visual conditions, or validating test outcomes with natural language.
---

# Making Assertions

Read: `node_modules/testdriverai/docs/v7/assert.mdx`
Read: `node_modules/testdriverai/docs/v7/making-assertions.mdx`

## Basic Usage

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

## Writing Good Assertions

**Be specific:**
```javascript
// ✅ Good
await testdriver.assert("the login button is visible in the header");
await testdriver.assert("user's name 'John' appears in the profile section");
await testdriver.assert("error message 'Invalid email' is displayed");

// ❌ Vague
await testdriver.assert("button visible");
await testdriver.assert("it worked");
```

**Describe what you see:**
```javascript
await testdriver.assert("the settings panel is open on the right side");
await testdriver.assert("a green success checkmark appears next to the form");
await testdriver.assert("the page shows 'Welcome back, John'");
```

**Include context:**
```javascript
await testdriver.assert("the shopping cart shows 3 items");
await testdriver.assert("the price total is $99.99");
await testdriver.assert("the submit button is disabled");
```

## Common Patterns

### After navigation
```javascript
await testdriver.find("Settings link").click();
const result = await testdriver.assert("Settings page is displayed");
expect(result).toBeTruthy();
```

### Form validation
```javascript
await testdriver.find("Submit button").click();
const hasError = await testdriver.assert("email validation error is shown");
expect(hasError).toBeTruthy();
```

### State changes
```javascript
await testdriver.find("Toggle switch").click();
const isOn = await testdriver.assert("the toggle is now in the ON position");
expect(isOn).toBeTruthy();
```

### Negative assertions
```javascript
const noError = await testdriver.assert("no error messages are visible");
expect(noError).toBeTruthy();
```

## Examples

See `node_modules/testdriverai/examples/assert.test.mjs`

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…