Overview

The AI_ASSERTION step uses AI to verify complex assertions about the page content. It takes a screenshot and analyzes both the visual appearance and HTML content to determine if your assertion is true.

Parameters

assertion
string
required
Natural language assertion to verify. The AI will analyze the page to determine if this assertion is true.

Behavior

  1. Screenshot Capture: Takes a screenshot of the current page
  2. HTML Collection: Gathers the page HTML structure
  3. AI Analysis: Sends screenshot and HTML to AI service
  4. Assertion Evaluation: AI evaluates if the assertion is true
  5. Result Return: Returns success if true, failure with explanation if false

Common Use Cases

  • Verifying complex visual layouts
  • Checking content organization and structure
  • Validating UI consistency and branding
  • Verifying responsive design behaviors
  • Checking for the presence of specific UI patterns
  • Validating data visualization correctness

Error Handling

The step will fail if:
  • The assertion evaluates to false
  • The AI service is unavailable
  • The screenshot cannot be captured
  • The page content cannot be analyzed
When assertions fail, the AI provides detailed explanations of why the assertion was not satisfied, helping with debugging.