Testdriver wait

From testdriverai/testdriverai · View interactive version

Testdriver wait is an AI agent skill from the GitHub repository testdriverai/testdriverai. Pause the execution of the script for a specified duration.

How to use this skill

Skill file

<!-- Generated from wait.mdx. DO NOT EDIT. -->

Description

The wait method stops the test for a number of milliseconds. Then it continues. Use this to add delays between actions, to wait for animations to complete, or to let state changes become stable.

Syntax

await testdriver.wait(timeout);

Arguments

| Argument | Type | Default | Description |

| --------- | -------- | ------- | ------------------------------------- |

| timeout | number | 3000 | The duration in milliseconds to wait. |

Examples

// Wait 2 seconds for an animation to complete
await testdriver.find('submit button').click();
await testdriver.wait(2000);

// Wait 5 seconds
await testdriver.wait(5000);

// Wait with default timeout (3 seconds)
await testdriver.wait();

Best Practices

```javascript

// ✅ Better for waiting for elements

const element = await testdriver.find('success message', { timeout: 30000 });

// ❌ Don't do this for element waiting

await testdriver.wait(5000);

const element = await testdriver.find('success message');

```

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.