Skip to main content

Overview

Make assertions about the screen state with natural language and AI. The AI examines the screen. It makes sure 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 the assertion passes. It throws an error if the assertion fails.

Examples

Basic Assertions

Best Practices

Be specific in assertionsMore specific assertions are more reliable:
Assert state changesMake sure of the 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