Skip to main content

Test Runs & Results

Execute generated tests, inspect results, access artifacts, and manage self-healing suggestions.


Test Runs

MethodPathWhat it does
POST/test-run/{test_case_id}Submit a run for a test case
GET/test-run/{test_run_id}Get a single run (full detail: steps, errors, artifacts)
GET/test-cases/{test_case_id}/runsFiltered, paginated run history
GET/test-runs/{test_case_id}List all runs for a test case
DELETE/test-run/cancel/{test_run_id}Cancel a queued run
DELETE/test-run/delete/{test_run_id}Delete a run record
GET/images/run/{test_run_id}/{image_id}Fetch a screenshot from a run
GET/artifacts/{test_run_id}Download a run artifact (video, trace — artifact_name query)

Run settings

POST /test-run/{test_case_id} accepts an optional RunSettings body to override execution context:

FieldDescription
platformfore_ai (default) or lambda_test
browser_type_overridechromium, firefox, webkit, or msedge
viewport_width_override / viewport_height_overrideBrowser viewport dimensions
website_url_overrideOverride the base URL (useful for staging environments)
parameter_overridesKey/value overrides for test parameters
proxy_id_override / disable_proxyProxy routing overrides
user_agent_overrideCustom user-agent string
accept_language_overrideLanguage header override
geolocation_override{ "latitude": 47.38, "longitude": 8.54 }
mobile_app_asset_id_overrideOverride the mobile app binary

Set platform to lambda_test (and configure LambdaTest credentials via PUT /customer/settings) to route runs through LambdaTest infrastructure instead of fore ai's default runners.

Example — submit and retrieve a run

# Trigger a run
curl -X POST "https://cj-backend.foreai.co/test-run/<test_case_id>" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"website_url_override": "https://staging.example.com"}'
"3f2504e0-4f89-11d3-9a0c-0305e82c3301"
# Fetch results
curl "https://cj-backend.foreai.co/test-run/3f2504e0-4f89-11d3-9a0c-0305e82c3301" \
-H "Authorization: Bearer <token>"
{
"_id": "3f2504e0-4f89-11d3-9a0c-0305e82c3301",
"test_case_id": "ddfa83cd-b43d-4b68-8931-42684931f58d",
"status": "failed",
"created_at": "2026-06-09T10:32:00Z",
"execution_time_in_secs": 12.4,
"failing_step_index": 2,
"user_friendly_error": "Could not find the Sign in button",
"artifacts": ["recording.webm"],
"steps": [...]
}

TestRun response fields

FieldTypeDescription
_idUUIDRun ID
test_case_idUUID
statusTestRunStatus
created_at / run_atdatetimeQueued timestamp vs actual start time
execution_time_in_secsnumber
failing_step_indexinteger0-based index of the first failed step
error_messagestringRaw error text
user_friendly_errorstringHuman-readable error description
artifactsstring[]Artifact filenames — download via GET /artifacts/{run_id}?artifact_name=<name>
stepsTestRunStep[]Per-step execution snapshots

TestRunStep fields

FieldTypeDescription
action_namestringStep name
step_descriptionstringWhat the step does
successboolean | nullnull if not yet executed
screenshot_idstringFetch via GET /images/run/{run_id}/{screenshot_id}
run_codestringThe Playwright code executed for this step

Filtering runs

GET /test-cases/{test_case_id}/runs accepts:

ParameterDescription
run_statusOne or more TestRunStatus values (repeat parameter for multiple)
created_at_range_start / created_at_range_endISO 8601 datetime bounds
run_idFetch a single specific run
offsetPagination offset (default 0)
limitResults per page (default 50, max 1000)

For ready-made CI/CD integrations (GitHub Actions, GitLab, Jenkins, Tekton, Azure DevOps), see CI/CD integrations.


Healing

Self-repair for tests broken by UI changes.

MethodPathWhat it does
POST/healing/test-case/{test_case_id}Create a healing suggestion for a failing test
GET/healing/test-case/{test_case_id}Get the current healing suggestion
GET/healing/test-run/{test_run_id}Get healing tied to a specific run
GET/healing/{test_healing_id}/diffView the diff between the original and healed test (per-step: unchanged, modified, added, removed)
POST/healing/{test_healing_id}/approveApprove or reject a healing (approved query); approving replaces the original steps with the healed ones

Output Artifacts & Logs

Access screenshots, recordings, and logs produced during test generation and test runs.

MethodPathWhat it does
GET/output_artifacts/test_runs/{test_run_id}List all artifacts from a run (videos, traces)
GET/output_artifacts/test_cases/{test_case_id}List artifacts from test generation
GET/images/{test_case_id}/{image_id}Fetch a screenshot captured during generation
GET/logs/{test_case_id}Fetch generation logs