Writing Tests

AI Steps

Generate dynamic content for your tests

AI steps use artificial intelligence to generate dynamic content for your tests, enabling flexible and realistic test scenarios.

Generate

Generate content using AI and save it to a variable. Useful for creating dynamic test data like names, emails, addresses, or any content that needs to vary between runs.

Configuration:

  • instruction (required): Natural language instruction describing what content to generate
  • variableName (required): Variable name to save the generated content for later use

Examples:

  • Generate a random email: "Generate a unique email address for testing"
  • Generate user data: "Generate a realistic full name"
  • Generate text content: "Generate a short product review, 2-3 sentences"

When to Use Generate

  • Creating unique test data for each run
  • Generating realistic user information
  • Creating varied content to test different scenarios
  • Avoiding hardcoded test data that may become stale

For built-in data generation with Faker and Falso libraries, see the JavaScript page.