Overview
TheTestingAPI provides methods for running agentic tests with natural language instructions and managing test jobs.
Methods
execute()
Runs an agentic test with natural language instructions and optional structured output.Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
options | TestOptions | Yes | Test execution options |
TestOptions
TestConfig
Returns
Promise<TestResult> - Test execution result
TestResult
Examples
create()
Creates an async test job without waiting for completion.Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
options | TestOptions | Yes | Test execution options |
Returns
Promise<TestJob> - Test job information
TestJob
Example
getStatus()
Gets the status and results of a test job.Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
jobId | string | Yes | Job ID to check |
Returns
Promise<TestJobStatus> - Detailed job status
TestJobStatus
Example
list()
Lists test jobs with optional filtering.Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
options | ListTestsOptions | No | Filtering and pagination options |
ListTestsOptions
Returns
Promise<TestJobsList> - List of test jobs
TestJobsList
Examples
test()
Convenience method for simple tests.Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
instructions | string | Yes | Test instructions |
url | string | Yes | URL to test |
options | TestExecutionOptions | No | Additional options |
TestExecutionOptions
Returns
Promise<TestResult> - Test result
Example
login()
Convenience method for login testing.Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
url | string | Yes | Login page URL |
credentials | LoginCredentials | Yes | Login credentials |
options | Partial<TestOptions> | No | Additional test options |
LoginCredentials
Returns
Promise<TestResult> - Login test result
Example
fillForm()
Convenience method for form filling tests.Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
url | string | Yes | Form page URL |
formData | object | Yes | Form field data |
options | Partial<TestOptions> | No | Additional test options |
Returns
Promise<TestResult> - Form filling test result
Example
Advanced Usage
Structured Output Schemas
Complex Test Scenarios
Error Handling and Validation
Job Monitoring and Reporting
Best Practices
Instruction Writing
- Be specific: Use clear, actionable language
- Include context: Describe what success looks like
- Handle edge cases: Consider what might go wrong
- Use sequences: Number steps for complex tests
- Specify timeouts: For operations that might take time
