Test Runs
Test Runs are instances of executing a test or set of tests. They capture the results, timeline, and any issues discovered during execution, creating an audit trail of verification activities.
Overview
Test Runs provide a complete record of test execution, documenting who performed the test, when it was executed, what was observed, and whether the criterion was met.
Test Runs:
- Record who performed the test
- Capture when the test was executed
- Document the outcome (pass/fail)
- Include notes and observations
- Store evidence and artifacts
- Create an audit trail
- Enable test history tracking
The Test Run Model
- Name
id
- Type
- string
- Description
Unique identifier for the test run.
- Name
testId
- Type
- string
- Description
ID of the test that was executed.
- Name
executedBy
- Type
- string
- Description
ID of the user who executed the test.
- Name
executedAt
- Type
- timestamp
- Description
Timestamp of when the test was executed.
- Name
status
- Type
- string
- Description
Overall status of the run (e.g., "passed", "failed", "blocked").
- Name
functionResults
- Type
- array
- Description
Results for each test function executed.
- Name
notes
- Type
- string
- Description
General notes about the test execution.
- Name
evidence
- Type
- array
- Description
Attached evidence files (screenshots, logs, etc.).
- Name
environment
- Type
- string
- Description
Environment where the test was executed.
- Name
duration
- Type
- number
- Description
Time taken to complete the test (in minutes).
- Name
createdAt
- Type
- timestamp
- Description
Timestamp of when the run was created.
- Name
updatedAt
- Type
- timestamp
- Description
Timestamp of when the run was last updated.
Creating Test Runs
Via the UI
- Navigate to a test
- Click "Execute Test"
- Follow each test function
- Record results for each function:
- Actual result observed
- Pass/Fail status
- Any notes
- Add overall test run information:
- General observations
- Evidence files
- Environment details
- Click "Complete Test Run"
Via the API
// Create a new test run
const testRun = await apiClient.testRuns.create({
testId: "test_id",
executedBy: "user_id",
executedAt: new Date().toISOString(),
environment: "Production",
functionResults: [
{
functionId: "function_1",
status: "passed",
actualResult: "Login page loaded with all expected elements",
notes: "Page load time was 1.2 seconds"
},
{
functionId: "function_2",
status: "passed",
actualResult: "Email address accepted and displayed correctly",
notes: null
},
{
functionId: "function_3",
status: "passed",
actualResult: "Password was properly masked",
notes: null
},
{
functionId: "function_4",
status: "failed",
actualResult: "Login failed with error: 'Invalid credentials'",
notes: "Test data may be incorrect"
}
],
status: "failed",
notes: "Test failed at login step. Need to verify test credentials.",
duration: 5
});
Test Run Statuses
Overall Test Run Status
- Passed: All test functions passed
- Failed: One or more test functions failed
- Blocked: Test could not be completed due to a blocking issue
- Skipped: Test was intentionally not executed
Function-Level Status
Each function within a test run can have its own status:
- Passed: Function executed successfully with expected results
- Failed: Function did not produce expected results
- Blocked: Function could not be executed
- Skipped: Function was intentionally skipped
Recording Evidence
Test runs can include various types of evidence:
- Screenshots: Visual proof of test results
- Log Files: System or application logs
- Data Exports: CSV, JSON, or other data files
- Videos: Screen recordings of test execution
- Documents: Supporting documentation
To attach evidence:
// Attach evidence to a test run
await apiClient.testRuns.attachEvidence(
"test_run_id",
{
filename: "login_error_screenshot.png",
type: "screenshot",
description: "Screenshot showing login error message",
data: base64EncodedImageData
}
);
Test Run History
Test runs create a historical record that enables:
- Trend Analysis: Track pass/fail rates over time
- Issue Identification: Spot recurring problems
- Audit Trail: Demonstrate testing compliance
- Performance Tracking: Monitor test execution times
- Root Cause Analysis: Investigate failures
Viewing Test Run History
Via the UI
- Navigate to a test
- Click "Run History"
- View list of all executions
- Click on any run to see details
Via the API
// Get test run history
const history = await apiClient.tests.getRunHistory("test_id", {
limit: 10,
orderBy: "executedAt",
order: "desc"
});
// Get specific test run details
const runDetails = await apiClient.testRuns.get("test_run_id");
Best Practices
- Complete Documentation: Record all observations, not just pass/fail
- Timely Execution: Execute test runs promptly when needed
- Detailed Notes: Include context that might help future debugging
- Evidence Collection: Capture screenshots or logs for failed functions
- Environment Details: Always note which environment was tested
- Accurate Timing: Record actual time spent on test execution
- Objective Results: Report what was observed, not interpretations
Test Run Reports
Test runs can be aggregated into reports showing:
- Overall test coverage
- Pass/fail trends
- Most frequently failing tests
- Average execution times
- Tester productivity
- Environment-specific results
API Reference
Endpoint | Method | Description |
---|---|---|
/api/v1/test-runs | POST | Create a new test run |
/api/v1/test-runs/{id} | GET | Get test run details |
/api/v1/test-runs/{id} | PUT | Update test run |
/api/v1/tests/{testId}/runs | GET | Get run history for a test |
/api/v1/test-runs/{id}/evidence | POST | Attach evidence to a run |
/api/v1/test-runs/{id}/evidence | GET | List evidence for a run |
For complete API details, refer to the API Reference.