Skip to main content

What is Context?

Context in Testpilot is additional information that helps the AI better understand:
  • How your application works
  • Special requirements or conditions for tests
  • Expected behaviors or edge cases
  • Login credentials or test data
Context is passed to the AI model along with your test steps, helping it make better decisions during test execution.

Adding Context to Your Tests

You can add context at two levels in your pilot files:

1. Global Context (Test Suite Level)

Global context applies to all test cases in a file. Add it at the root level of your test file:

2. Test-Specific Context (Test Case Level)

Test-specific context applies only to a single test case:

Best Practices for Adding Context

Be Specific and Relevant

Add context that directly helps with test execution:

Explain UI Components

Describe important UI elements and their behavior:

Provide Business Rules

Include relevant business logic or validation rules:

Specify Test Environment Details

Include information about your test environment:

When to Use Additional Context

Add extra context when:
  1. Your application has unique or complex behaviors that might not be immediately obvious
  2. Test steps require specific knowledge about the application state or business rules
  3. Handling error conditions or edge cases that require special treatment