AI-Powered Test Generation
Learn how AegisRunner uses AI to automatically generate comprehensive test suites from your crawl data.
AI Test Generation
AegisRunner uses artificial intelligence to automatically generate comprehensive test suites from your crawl data. This feature dramatically reduces the time needed to create end-to-end tests.
How It Works
The AI analyzes pages discovered during your crawl, including DOM structure, interactive elements, and forms.
It identifies clickable elements, form inputs, navigation patterns, and user interaction points.
Based on the analysis, the AI creates test cases that verify page loads, form submissions, navigation, and assertions.
Tests are organized into logical suites grouped by page or functionality.
What Gets Tested
AI-generated tests typically include:
Page Tests
- Page loads successfully (status 200)
- Title matches expected value
- Key elements are visible
- No JavaScript console errors
- Page loads within acceptable time
Navigation Tests
- Links navigate to correct destinations
- Menu items work correctly
- Breadcrumbs function properly
- Back/forward navigation works
Form Tests
- Forms accept valid input
- Form validation triggers on invalid input
- Submit buttons are clickable
- Success/error messages appear appropriately
Interactive Element Tests
- Buttons respond to clicks
- Dropdowns expand and collapse
- Modals open and close
- Tabs switch content correctly
Viewing Generated Suites
After a crawl completes, find your generated suites:
- Navigate to Test Suites
- Use the Filter by Crawl dropdown
- Select the crawl session
- View all suites generated from that crawl
Test Suite Actions
For each generated suite, you can:
| Action | Description |
|---|---|
| Run | Execute the test suite in a selected browser |
| Edit | Modify test steps, assertions, and settings |
| Export Playwright | Download as Playwright test code |
| Delete | Remove the test suite |
Using Test Variables
AI-generated tests can use variables for dynamic data. Define variables in Test Data → Test Variables.
Variables use the {{variableName}} syntax:
// Example usage in tests
Fill input#email with {{testEmail}}
Fill input#password with {{testPassword}}
Click button[type="submit"]
This allows you to:
- Run tests with different data sets
- Keep sensitive data out of test code
- Easily update test data without editing tests
Improving Generated Tests
AI-generated tests are a great starting point, but you may want to enhance them:
- Add custom assertions for business logic
- Include wait conditions for async operations
- Add data-driven scenarios using variables
- Create user flow tests for multi-page journeys
- Remove or modify tests that aren't applicable
Regenerating Tests
If you've made significant changes to your website:
- Run a new crawl
- New test suites will be generated
- Compare with previous suites
- Keep tests that are still valid
- Delete outdated tests
Custom Test Suite Creation
In addition to AI generation, you can create custom suites:
- Click + New Suite in Test Suites
- Choose from:
- New Suite - Create from scratch
- User Flow - Multi-page user journey
- Merge Suites - Combine existing suites
- Define test steps and assertions
- Save and run
Best Practices
- Crawl with form filling enabled to generate form tests
- Use a comprehensive crawl (higher max pages) for better coverage
- Review generated tests and remove irrelevant ones
- Add custom tests for critical business flows
- Set up test variables for dynamic data like usernames/passwords
- Re-crawl after major site updates to regenerate tests
Related Documentation
- User Flow Tests - Create multi-page test journeys
- Composite Test Suites - Merge multiple suites
- Test Data Management - Configure test variables
- Running Tests - Execute your tests
API Test Generation
When your crawl data includes API endpoints (from form submissions, AJAX requests, or network traffic), the AI can generate api-request test steps:
- Health checks — Verify API endpoints return expected status codes
- CRUD operations — Test create, read, update, delete flows
- Response validation — Assert on response body structure and values
- Performance gates — Set response time thresholds
See API Testing for details on configuring API test steps.