Overview

AI Validation steps allow you to verify simple conditions using natural language assertions. Each validation should focus on checking a single aspect of your application, such as text content, element presence, colors, or layout.

Key Benefits

  • Natural Language Assertions: Write validations as you would describe them to a human
  • Reduced Maintenance: Less brittle than traditional selector-based assertions
  • Visual Understanding: Can verify colors, layouts, and visual properties easily

Use Cases

Text Validation

"assertion": "Verify that the heading says 'Welcome back'"

Element State

"assertion": "Verify that the login button is enabled"

Visual Properties

"assertion": "Verify that the error message has a red background"

Layout Position

"assertion": "Verify that the search bar is centered at the top"

Best Practices

  1. Keep It Simple: Focus on one check per validation
// Good
"assertion": "Verify that the submit button is disabled"
   
// Avoid
"assertion": "Verify that the form shows validation errors and the submit button is disabled and error messages are in red"
  1. Be Specific: Clearly state what you’re checking
// Good
"assertion": "Verify that the price '$29.99' is visible"
   
// Avoid
"assertion": "Check if the price is correct"

Tips for Success

  1. Write one validation per check
  2. Be explicit about what you’re verifying
  3. Use clear, specific language
  4. Focus on visual properties that are easy to describe
  5. Break complex validations into multiple simple ones