Skip to main content

Overview

Make AI-powered assertions about the current screen state using natural language. The AI analyzes the screen and verifies that your assertion is true.

Syntax

Parameters

string
required
Natural language description of what should be true
object
Optional configuration

Returns

Promise<boolean> - true if assertion passes, throws error if assertion fails

Examples

Basic Assertions

Best Practices

Be specific in assertionsMore specific assertions are more reliable:
Assert state changesVerify state before and after actions:
Use with test framework assertionsCombine AI assertions with traditional test assertions:

Polling Assertions

For conditions that may take time to become true:

Use Cases

Complete Example

  • extract() - Extract information for detailed assertions
  • find() - Locate elements to verify