> For the complete documentation index, see [llms.txt](https://docs.bugbug.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bugbug.io/public-api-reference/test-runs.md).

# Test Runs

Executing tests and getting result

## Returns list of historical TestRuns

> Returns list of historical TestRuns

```json
{"openapi":"3.1.0","info":{"title":"BugBug.io Public API","version":"v2"},"tags":[{"name":"Test runs","description":"Executing tests and getting result"}],"security":[{"tokenAuth":[]},{"Bearer":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Token-based authentication with required prefix \"Token\""}},"schemas":{"PaginatedV2TestRunList":{"type":"object","required":["count","results"],"properties":{"count":{"type":"integer"},"next":{"type":"string","nullable":true,"format":"uri"},"previous":{"type":"string","nullable":true,"format":"uri"},"results":{"type":"array","items":{"$ref":"#/components/schemas/V2TestRun"}}}},"V2TestRun":{"type":"object","properties":{"browserName":{"type":["string","null"],"readOnly":true},"browserHeight":{"type":["integer","null"],"readOnly":true},"browserVersion":{"type":["string","null"],"readOnly":true},"browserWidth":{"type":["integer","null"],"readOnly":true},"duration":{"type":["string","null"],"readOnly":true},"ended":{"type":["string","null"],"format":"date-time","readOnly":true},"errorCode":{"type":["string","null"],"readOnly":true},"extensionVersion":{"type":["string","null"],"readOnly":true},"id":{"type":"string","format":"uuid","readOnly":true},"isAutoRetried":{"type":"boolean","readOnly":true},"name":{"type":"string","readOnly":true},"notes":{"type":["string","null"],"readOnly":true},"osName":{"type":["string","null"],"readOnly":true},"profileId":{"type":"string","format":"uuid","readOnly":true},"profileName":{"type":"string","readOnly":true},"queued":{"type":["string","null"],"format":"date-time","readOnly":true},"runMode":{"enum":["server","local","recording"],"type":"string","description":"* `server` - cloud\n* `local` - local\n* `recording` - recording","readOnly":true},"runProfileId":{"type":["string","null"],"format":"uuid","readOnly":true},"screenSizeType":{"enum":["desktop","mobile","custom"],"type":"string","description":"* `desktop` - Desktop\n* `mobile` - Mobile\n* `custom` - Custom","readOnly":true},"section":{"enum":["main","before_all","after_all"],"type":"string","description":"* `main` - Main\n* `before_all` - Before all\n* `after_all` - After all","readOnly":true},"sequence":{"type":["integer","null"],"readOnly":true},"started":{"type":["string","null"],"format":"date-time","readOnly":true},"status":{"enum":["error","passed","failed","running","auto_retrying","stopped","queued","paused","skipped","recording","initialized"],"type":"string","description":"* `error` - Error\n* `passed` - Passed\n* `failed` - Failed\n* `running` - Running\n* `auto_retrying` - Auto Retrying\n* `stopped` - Stopped\n* `queued` - Queued\n* `paused` - Paused\n* `skipped` - Skipped\n* `recording` - Recording\n* `initialized` - Initialized","readOnly":true},"stepsRuns":{"type":"string","readOnly":true},"suiteRunId":{"type":["string","null"],"format":"uuid","readOnly":true},"tags":{"type":"array","items":{"$ref":"#/components/schemas/V2RunTag"},"readOnly":true},"testId":{"type":["string","null"],"format":"uuid","readOnly":true},"triggeredBy":{"enum":["user","api","webhook","scheduler","github","cli","agent","vercel"],"type":"string","description":"* `user` - User\n* `api` - Api\n* `webhook` - Webhook\n* `scheduler` - Scheduler\n* `github` - Github\n* `cli` - Cli\n* `agent` - Agent\n* `vercel` - Vercel","readOnly":true},"userId":{"type":["string","null"],"format":"uuid","readOnly":true},"webappUrl":{"type":"string","readOnly":true}},"required":["browserHeight","browserName","browserVersion","browserWidth","duration","ended","errorCode","extensionVersion","id","isAutoRetried","name","notes","osName","profileId","profileName","queued","runMode","runProfileId","screenSizeType","section","sequence","started","status","stepsRuns","suiteRunId","tags","testId","triggeredBy","userId","webappUrl"]},"V2RunTag":{"type":"object","properties":{"id":{"type":"string","format":"uuid","readOnly":true},"name":{"type":"string","readOnly":true},"color":{"type":"string","readOnly":true},"inherited":{"type":"boolean","readOnly":true}},"required":["color","id","inherited","name"]}}},"paths":{"/api/v2/testruns/":{"get":{"operationId":"v2_testruns_list","description":"Returns list of historical TestRuns","summary":"Returns list of historical TestRuns","parameters":[{"in":"query","name":"ordering","schema":{"type":"string","enum":["-created","-started","created","started"]},"description":"Sort list by param"},{"name":"page","required":false,"in":"query","description":"A page number within the paginated result set.","schema":{"type":"integer"}},{"name":"page_size","required":false,"in":"query","description":"Number of results to return per page.","schema":{"type":"integer"}},{"in":"query","name":"started_after","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"started_before","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"status","schema":{"type":"string","enum":["auto_retrying","error","failed","initialized","passed","paused","queued","recording","running","skipped","stopped"]},"description":"* `error` - Error\n* `passed` - Passed\n* `failed` - Failed\n* `running` - Running\n* `auto_retrying` - Auto Retrying\n* `stopped` - Stopped\n* `queued` - Queued\n* `paused` - Paused\n* `skipped` - Skipped\n* `recording` - Recording\n* `initialized` - Initialized"},{"in":"query","name":"tags","schema":{"type":"string"},"description":"Comma-separated tag names. Names cannot contain commas. Matching is case-insensitive and uses AND semantics."},{"in":"query","name":"testId","schema":{"type":"string","format":"uuid"},"description":"Filter by test id."}],"tags":["Test runs"],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedV2TestRunList"}}},"description":""},"401":{"description":"Authentication credentials were missing or invalid."}}}}}}
```

## Execute desired test

> Execute desired test.

```json
{"openapi":"3.1.0","info":{"title":"BugBug.io Public API","version":"v2"},"tags":[{"name":"Test runs","description":"Executing tests and getting result"}],"security":[{"tokenAuth":[]},{"Bearer":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Token-based authentication with required prefix \"Token\""}},"schemas":{"V2RunTestDocs":{"type":"object","properties":{"testId":{"type":"string","format":"uuid"},"runProfileId":{"type":["string","null"],"format":"uuid"},"variables":{"type":["array","null"],"items":{"$ref":"#/components/schemas/V2OverrideVariable"},"default":[]},"tags":{"type":"array","items":{"type":"string","maxLength":64},"maxItems":64}},"required":["testId"]},"V2OverrideVariable":{"type":"object","properties":{"key":{"type":"string","maxLength":128},"value":{"type":["string","null"]}},"required":["key"]},"V2TestRunState":{"type":"object","properties":{"duration":{"type":["string","null"],"readOnly":true},"finishedSteps":{"type":"integer","readOnly":true},"id":{"type":"string","format":"uuid","readOnly":true},"modified":{"type":"string","format":"date-time","readOnly":true},"status":{"enum":["error","passed","failed","running","auto_retrying","stopped","queued","paused","skipped","recording","initialized"],"type":"string","description":"* `error` - Error\n* `passed` - Passed\n* `failed` - Failed\n* `running` - Running\n* `auto_retrying` - Auto Retrying\n* `stopped` - Stopped\n* `queued` - Queued\n* `paused` - Paused\n* `skipped` - Skipped\n* `recording` - Recording\n* `initialized` - Initialized","readOnly":true},"tags":{"type":"array","items":{"$ref":"#/components/schemas/V2RunTag"},"readOnly":true},"totalSteps":{"type":"integer","readOnly":true},"webappUrl":{"type":"string","readOnly":true}},"required":["duration","finishedSteps","id","modified","status","tags","totalSteps","webappUrl"]},"V2RunTag":{"type":"object","properties":{"id":{"type":"string","format":"uuid","readOnly":true},"name":{"type":"string","readOnly":true},"color":{"type":"string","readOnly":true},"inherited":{"type":"boolean","readOnly":true}},"required":["color","id","inherited","name"]}}},"paths":{"/api/v2/testruns/":{"post":{"operationId":"v2_testruns_create","description":"Execute desired test.","summary":"Execute desired test","tags":["Test runs"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V2RunTestDocs"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V2TestRunState"}}},"description":""},"400":{"description":"Request body failed validation."},"401":{"description":"Authentication credentials were missing or invalid."}}}}}}
```

## Retrieve test run result

> Returns single object.

```json
{"openapi":"3.1.0","info":{"title":"BugBug.io Public API","version":"v2"},"tags":[{"name":"Test runs","description":"Executing tests and getting result"}],"security":[{"tokenAuth":[]},{"Bearer":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Token-based authentication with required prefix \"Token\""}},"schemas":{"V2TestRun":{"type":"object","properties":{"browserName":{"type":["string","null"],"readOnly":true},"browserHeight":{"type":["integer","null"],"readOnly":true},"browserVersion":{"type":["string","null"],"readOnly":true},"browserWidth":{"type":["integer","null"],"readOnly":true},"duration":{"type":["string","null"],"readOnly":true},"ended":{"type":["string","null"],"format":"date-time","readOnly":true},"errorCode":{"type":["string","null"],"readOnly":true},"extensionVersion":{"type":["string","null"],"readOnly":true},"id":{"type":"string","format":"uuid","readOnly":true},"isAutoRetried":{"type":"boolean","readOnly":true},"name":{"type":"string","readOnly":true},"notes":{"type":["string","null"],"readOnly":true},"osName":{"type":["string","null"],"readOnly":true},"profileId":{"type":"string","format":"uuid","readOnly":true},"profileName":{"type":"string","readOnly":true},"queued":{"type":["string","null"],"format":"date-time","readOnly":true},"runMode":{"enum":["server","local","recording"],"type":"string","description":"* `server` - cloud\n* `local` - local\n* `recording` - recording","readOnly":true},"runProfileId":{"type":["string","null"],"format":"uuid","readOnly":true},"screenSizeType":{"enum":["desktop","mobile","custom"],"type":"string","description":"* `desktop` - Desktop\n* `mobile` - Mobile\n* `custom` - Custom","readOnly":true},"section":{"enum":["main","before_all","after_all"],"type":"string","description":"* `main` - Main\n* `before_all` - Before all\n* `after_all` - After all","readOnly":true},"sequence":{"type":["integer","null"],"readOnly":true},"started":{"type":["string","null"],"format":"date-time","readOnly":true},"status":{"enum":["error","passed","failed","running","auto_retrying","stopped","queued","paused","skipped","recording","initialized"],"type":"string","description":"* `error` - Error\n* `passed` - Passed\n* `failed` - Failed\n* `running` - Running\n* `auto_retrying` - Auto Retrying\n* `stopped` - Stopped\n* `queued` - Queued\n* `paused` - Paused\n* `skipped` - Skipped\n* `recording` - Recording\n* `initialized` - Initialized","readOnly":true},"stepsRuns":{"type":"string","readOnly":true},"suiteRunId":{"type":["string","null"],"format":"uuid","readOnly":true},"tags":{"type":"array","items":{"$ref":"#/components/schemas/V2RunTag"},"readOnly":true},"testId":{"type":["string","null"],"format":"uuid","readOnly":true},"triggeredBy":{"enum":["user","api","webhook","scheduler","github","cli","agent","vercel"],"type":"string","description":"* `user` - User\n* `api` - Api\n* `webhook` - Webhook\n* `scheduler` - Scheduler\n* `github` - Github\n* `cli` - Cli\n* `agent` - Agent\n* `vercel` - Vercel","readOnly":true},"userId":{"type":["string","null"],"format":"uuid","readOnly":true},"webappUrl":{"type":"string","readOnly":true}},"required":["browserHeight","browserName","browserVersion","browserWidth","duration","ended","errorCode","extensionVersion","id","isAutoRetried","name","notes","osName","profileId","profileName","queued","runMode","runProfileId","screenSizeType","section","sequence","started","status","stepsRuns","suiteRunId","tags","testId","triggeredBy","userId","webappUrl"]},"V2RunTag":{"type":"object","properties":{"id":{"type":"string","format":"uuid","readOnly":true},"name":{"type":"string","readOnly":true},"color":{"type":"string","readOnly":true},"inherited":{"type":"boolean","readOnly":true}},"required":["color","id","inherited","name"]}}},"paths":{"/api/v2/testruns/{id}/":{"get":{"operationId":"v2_testruns_retrieve","description":"Returns single object.","summary":"Retrieve test run result","parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid"},"description":"A UUID string identifying this test run.","required":true}],"tags":["Test runs"],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V2TestRun"}}},"description":""},"401":{"description":"Authentication credentials were missing or invalid."},"404":{"description":"Resource not found."}}}}}}
```

## Update test run

> Partially updates the test run. Only \`notes\` can be changed.

```json
{"openapi":"3.1.0","info":{"title":"BugBug.io Public API","version":"v2"},"tags":[{"name":"Test runs","description":"Executing tests and getting result"}],"security":[{"tokenAuth":[]},{"Bearer":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Token-based authentication with required prefix \"Token\""}},"schemas":{"PatchedV2RunUpdate":{"type":"object","properties":{"notes":{"type":["string","null"],"maxLength":1024}}},"V2TestRun":{"type":"object","properties":{"browserName":{"type":["string","null"],"readOnly":true},"browserHeight":{"type":["integer","null"],"readOnly":true},"browserVersion":{"type":["string","null"],"readOnly":true},"browserWidth":{"type":["integer","null"],"readOnly":true},"duration":{"type":["string","null"],"readOnly":true},"ended":{"type":["string","null"],"format":"date-time","readOnly":true},"errorCode":{"type":["string","null"],"readOnly":true},"extensionVersion":{"type":["string","null"],"readOnly":true},"id":{"type":"string","format":"uuid","readOnly":true},"isAutoRetried":{"type":"boolean","readOnly":true},"name":{"type":"string","readOnly":true},"notes":{"type":["string","null"],"readOnly":true},"osName":{"type":["string","null"],"readOnly":true},"profileId":{"type":"string","format":"uuid","readOnly":true},"profileName":{"type":"string","readOnly":true},"queued":{"type":["string","null"],"format":"date-time","readOnly":true},"runMode":{"enum":["server","local","recording"],"type":"string","description":"* `server` - cloud\n* `local` - local\n* `recording` - recording","readOnly":true},"runProfileId":{"type":["string","null"],"format":"uuid","readOnly":true},"screenSizeType":{"enum":["desktop","mobile","custom"],"type":"string","description":"* `desktop` - Desktop\n* `mobile` - Mobile\n* `custom` - Custom","readOnly":true},"section":{"enum":["main","before_all","after_all"],"type":"string","description":"* `main` - Main\n* `before_all` - Before all\n* `after_all` - After all","readOnly":true},"sequence":{"type":["integer","null"],"readOnly":true},"started":{"type":["string","null"],"format":"date-time","readOnly":true},"status":{"enum":["error","passed","failed","running","auto_retrying","stopped","queued","paused","skipped","recording","initialized"],"type":"string","description":"* `error` - Error\n* `passed` - Passed\n* `failed` - Failed\n* `running` - Running\n* `auto_retrying` - Auto Retrying\n* `stopped` - Stopped\n* `queued` - Queued\n* `paused` - Paused\n* `skipped` - Skipped\n* `recording` - Recording\n* `initialized` - Initialized","readOnly":true},"stepsRuns":{"type":"string","readOnly":true},"suiteRunId":{"type":["string","null"],"format":"uuid","readOnly":true},"tags":{"type":"array","items":{"$ref":"#/components/schemas/V2RunTag"},"readOnly":true},"testId":{"type":["string","null"],"format":"uuid","readOnly":true},"triggeredBy":{"enum":["user","api","webhook","scheduler","github","cli","agent","vercel"],"type":"string","description":"* `user` - User\n* `api` - Api\n* `webhook` - Webhook\n* `scheduler` - Scheduler\n* `github` - Github\n* `cli` - Cli\n* `agent` - Agent\n* `vercel` - Vercel","readOnly":true},"userId":{"type":["string","null"],"format":"uuid","readOnly":true},"webappUrl":{"type":"string","readOnly":true}},"required":["browserHeight","browserName","browserVersion","browserWidth","duration","ended","errorCode","extensionVersion","id","isAutoRetried","name","notes","osName","profileId","profileName","queued","runMode","runProfileId","screenSizeType","section","sequence","started","status","stepsRuns","suiteRunId","tags","testId","triggeredBy","userId","webappUrl"]},"V2RunTag":{"type":"object","properties":{"id":{"type":"string","format":"uuid","readOnly":true},"name":{"type":"string","readOnly":true},"color":{"type":"string","readOnly":true},"inherited":{"type":"boolean","readOnly":true}},"required":["color","id","inherited","name"]}}},"paths":{"/api/v2/testruns/{id}/":{"patch":{"operationId":"v2_testruns_partial_update","description":"Partially updates the test run. Only `notes` can be changed.","summary":"Update test run","parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid"},"description":"A UUID string identifying this test run.","required":true}],"tags":["Test runs"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchedV2RunUpdate"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V2TestRun"}}},"description":""},"400":{"description":"Request body failed validation."},"401":{"description":"Authentication credentials were missing or invalid."},"404":{"description":"Resource not found."}}}}}}
```

## List test run debug artifacts

> Returns list of debug artifacts attached to the test run.

```json
{"openapi":"3.1.0","info":{"title":"BugBug.io Public API","version":"v2"},"tags":[{"name":"Test runs","description":"Executing tests and getting result"}],"security":[{"tokenAuth":[]},{"Bearer":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Token-based authentication with required prefix \"Token\""}},"schemas":{"DebugArtifact":{"type":"object","properties":{"id":{"type":"string","format":"uuid","readOnly":true},"kind":{"enum":["logs_partial","logs","cloud_logs","container_stats","chrome_debug_logs","dom_snapshot","network_logs"],"type":"string","description":"* `logs_partial` - Logs Partial\n* `logs` - Logs\n* `cloud_logs` - Cloud Logs\n* `container_stats` - Container Stats\n* `chrome_debug_logs` - Chrome Debug Logs\n* `dom_snapshot` - Dom Snapshot\n* `network_logs` - Network Logs","readOnly":true},"file":{"type":"string"},"fileExtension":{"type":["string","null"],"readOnly":true},"contentType":{"type":["string","null"],"readOnly":true},"expirationTime":{"type":["string","null"],"format":"date-time","readOnly":true,"description":"None for eternal"}},"required":["contentType","expirationTime","file","fileExtension","id","kind"]}}},"paths":{"/api/v2/testruns/{id}/debug-artifacts/":{"get":{"operationId":"v2_testruns_debug_artifacts_list","description":"Returns list of debug artifacts attached to the test run.","summary":"List test run debug artifacts","parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid"},"description":"A UUID string identifying this test run.","required":true}],"tags":["Test runs"],"responses":{"200":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DebugArtifact"}}}},"description":""},"401":{"description":"Authentication credentials were missing or invalid."},"404":{"description":"Resource not found."}}}}}}
```

## Retrieve test run debug artifact by kind

> Returns a single debug artifact of the given kind attached to the test run.

```json
{"openapi":"3.1.0","info":{"title":"BugBug.io Public API","version":"v2"},"tags":[{"name":"Test runs","description":"Executing tests and getting result"}],"security":[{"tokenAuth":[]},{"Bearer":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Token-based authentication with required prefix \"Token\""}},"schemas":{"DebugArtifact":{"type":"object","properties":{"id":{"type":"string","format":"uuid","readOnly":true},"kind":{"enum":["logs_partial","logs","cloud_logs","container_stats","chrome_debug_logs","dom_snapshot","network_logs"],"type":"string","description":"* `logs_partial` - Logs Partial\n* `logs` - Logs\n* `cloud_logs` - Cloud Logs\n* `container_stats` - Container Stats\n* `chrome_debug_logs` - Chrome Debug Logs\n* `dom_snapshot` - Dom Snapshot\n* `network_logs` - Network Logs","readOnly":true},"file":{"type":"string"},"fileExtension":{"type":["string","null"],"readOnly":true},"contentType":{"type":["string","null"],"readOnly":true},"expirationTime":{"type":["string","null"],"format":"date-time","readOnly":true,"description":"None for eternal"}},"required":["contentType","expirationTime","file","fileExtension","id","kind"]}}},"paths":{"/api/v2/testruns/{id}/debug-artifacts/{artifact_type}/":{"get":{"operationId":"v2_testruns_debug_artifacts_retrieve","description":"Returns a single debug artifact of the given kind attached to the test run.","summary":"Retrieve test run debug artifact by kind","parameters":[{"in":"path","name":"artifact_type","schema":{"type":"string","enum":["chrome_debug_logs","cloud_logs","container_stats","dom_snapshot","logs","logs_partial","network_logs"]},"description":"Debug artifact type.","required":true},{"in":"path","name":"id","schema":{"type":"string","format":"uuid"},"description":"A UUID string identifying this test run.","required":true}],"tags":["Test runs"],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DebugArtifact"}}},"description":""},"401":{"description":"Authentication credentials were missing or invalid."},"404":{"description":"Artifact not found"}}}}}}
```

## Download test run logs

> Download the logs for the selected test run.

```json
{"openapi":"3.1.0","info":{"title":"BugBug.io Public API","version":"v2"},"tags":[{"name":"Test runs","description":"Executing tests and getting result"}],"security":[{"tokenAuth":[]},{"Bearer":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Token-based authentication with required prefix \"Token\""}}},"paths":{"/api/v2/testruns/{id}/logs/":{"get":{"operationId":"v2_testruns_logs_retrieve","description":"Download the logs for the selected test run.","summary":"Download test run logs","parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid"},"description":"A UUID string identifying this test run.","required":true}],"tags":["Test runs"],"responses":{"302":{"description":"Redirect to logs file"},"401":{"description":"Authentication credentials were missing or invalid."},"404":{"description":"Logs not found or expired"}}}}}}
```

## Download JUnit XML report

> Download the JUnit XML report for the selected test run.

```json
{"openapi":"3.1.0","info":{"title":"BugBug.io Public API","version":"v2"},"tags":[{"name":"Test runs","description":"Executing tests and getting result"}],"security":[{"tokenAuth":[]},{"Bearer":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Token-based authentication with required prefix \"Token\""}}},"paths":{"/api/v2/testruns/{id}/report/junit/":{"get":{"operationId":"v2_testruns_report_junit_retrieve","description":"Download the JUnit XML report for the selected test run.","summary":"Download JUnit XML report","parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid"},"description":"A UUID string identifying this test run.","required":true}],"tags":["Test runs"],"responses":{"200":{"content":{"application/json":{"schema":{"type":"string","format":"binary"}}},"description":"JUnit XML report file"},"401":{"description":"Authentication credentials were missing or invalid."},"404":{"description":"Resource not found."}}}}}}
```

## Get test run steps screenshots

> Returns all screenshots.

```json
{"openapi":"3.1.0","info":{"title":"BugBug.io Public API","version":"v2"},"tags":[{"name":"Test runs","description":"Executing tests and getting result"}],"security":[{"tokenAuth":[]},{"Bearer":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Token-based authentication with required prefix \"Token\""}},"schemas":{"V2TestRunScreenshots":{"type":"object","properties":{"id":{"type":"string","format":"uuid","readOnly":true},"stepsRuns":{"type":"array","items":{"$ref":"#/components/schemas/V2StepRunScreenshot"},"readOnly":true}},"required":["id","stepsRuns"]},"V2StepRunScreenshot":{"type":"object","properties":{"id":{"type":"string","format":"uuid","readOnly":true},"stepId":{"type":["string","null"],"format":"uuid","readOnly":true},"screenshotUrl":{"type":"string"}},"required":["id","screenshotUrl","stepId"]}}},"paths":{"/api/v2/testruns/{id}/screenshots/":{"get":{"operationId":"v2_testruns_screenshots_retrieve","description":"Returns all screenshots.","summary":"Get test run steps screenshots","parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid"},"description":"A UUID string identifying this test run.","required":true}],"tags":["Test runs"],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V2TestRunScreenshots"}}},"description":""},"401":{"description":"Authentication credentials were missing or invalid."},"404":{"description":"Resource not found."}}}}}}
```

## Get test run status

> Returns single object.

```json
{"openapi":"3.1.0","info":{"title":"BugBug.io Public API","version":"v2"},"tags":[{"name":"Test runs","description":"Executing tests and getting result"}],"security":[{"tokenAuth":[]},{"Bearer":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Token-based authentication with required prefix \"Token\""}},"schemas":{"V2TestRunState":{"type":"object","properties":{"duration":{"type":["string","null"],"readOnly":true},"finishedSteps":{"type":"integer","readOnly":true},"id":{"type":"string","format":"uuid","readOnly":true},"modified":{"type":"string","format":"date-time","readOnly":true},"status":{"enum":["error","passed","failed","running","auto_retrying","stopped","queued","paused","skipped","recording","initialized"],"type":"string","description":"* `error` - Error\n* `passed` - Passed\n* `failed` - Failed\n* `running` - Running\n* `auto_retrying` - Auto Retrying\n* `stopped` - Stopped\n* `queued` - Queued\n* `paused` - Paused\n* `skipped` - Skipped\n* `recording` - Recording\n* `initialized` - Initialized","readOnly":true},"tags":{"type":"array","items":{"$ref":"#/components/schemas/V2RunTag"},"readOnly":true},"totalSteps":{"type":"integer","readOnly":true},"webappUrl":{"type":"string","readOnly":true}},"required":["duration","finishedSteps","id","modified","status","tags","totalSteps","webappUrl"]},"V2RunTag":{"type":"object","properties":{"id":{"type":"string","format":"uuid","readOnly":true},"name":{"type":"string","readOnly":true},"color":{"type":"string","readOnly":true},"inherited":{"type":"boolean","readOnly":true}},"required":["color","id","inherited","name"]}}},"paths":{"/api/v2/testruns/{id}/status/":{"get":{"operationId":"v2_testruns_status_retrieve","description":"Returns single object.","summary":"Get test run status","parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid"},"description":"A UUID string identifying this test run.","required":true}],"tags":["Test runs"],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V2TestRunState"}}},"description":""},"401":{"description":"Authentication credentials were missing or invalid."},"404":{"description":"Resource not found."}}}}}}
```

## Stop running test run

> Stop test run

```json
{"openapi":"3.1.0","info":{"title":"BugBug.io Public API","version":"v2"},"tags":[{"name":"Test runs","description":"Executing tests and getting result"}],"security":[{"tokenAuth":[]},{"Bearer":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Token-based authentication with required prefix \"Token\""}},"schemas":{"V2TestRunState":{"type":"object","properties":{"duration":{"type":["string","null"],"readOnly":true},"finishedSteps":{"type":"integer","readOnly":true},"id":{"type":"string","format":"uuid","readOnly":true},"modified":{"type":"string","format":"date-time","readOnly":true},"status":{"enum":["error","passed","failed","running","auto_retrying","stopped","queued","paused","skipped","recording","initialized"],"type":"string","description":"* `error` - Error\n* `passed` - Passed\n* `failed` - Failed\n* `running` - Running\n* `auto_retrying` - Auto Retrying\n* `stopped` - Stopped\n* `queued` - Queued\n* `paused` - Paused\n* `skipped` - Skipped\n* `recording` - Recording\n* `initialized` - Initialized","readOnly":true},"tags":{"type":"array","items":{"$ref":"#/components/schemas/V2RunTag"},"readOnly":true},"totalSteps":{"type":"integer","readOnly":true},"webappUrl":{"type":"string","readOnly":true}},"required":["duration","finishedSteps","id","modified","status","tags","totalSteps","webappUrl"]},"V2RunTag":{"type":"object","properties":{"id":{"type":"string","format":"uuid","readOnly":true},"name":{"type":"string","readOnly":true},"color":{"type":"string","readOnly":true},"inherited":{"type":"boolean","readOnly":true}},"required":["color","id","inherited","name"]}}},"paths":{"/api/v2/testruns/{id}/stop/":{"post":{"operationId":"v2_testruns_stop_create","description":"Stop test run","summary":"Stop running test run","parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid"},"description":"A UUID string identifying this test run.","required":true}],"tags":["Test runs"],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V2TestRunState"}}},"description":""},"400":{"description":"Request body failed validation."},"401":{"description":"Authentication credentials were missing or invalid."},"404":{"description":"Resource not found."}}}}}}
```

## Replace test run tags

> Replaces directly assigned tags. Inherited tags are preserved. Tag names that do not exist yet are created in the project with a default color.

```json
{"openapi":"3.1.0","info":{"title":"BugBug.io Public API","version":"v2"},"tags":[{"name":"Test runs","description":"Executing tests and getting result"}],"security":[{"tokenAuth":[]},{"Bearer":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Token-based authentication with required prefix \"Token\""}},"schemas":{"V2RunTagsUpdate":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"string","maxLength":64},"maxItems":64},"tagIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":64}}},"V2RunTag":{"type":"object","properties":{"id":{"type":"string","format":"uuid","readOnly":true},"name":{"type":"string","readOnly":true},"color":{"type":"string","readOnly":true},"inherited":{"type":"boolean","readOnly":true}},"required":["color","id","inherited","name"]}}},"paths":{"/api/v2/testruns/{id}/tags/":{"put":{"operationId":"v2_testruns_tags_update","description":"Replaces directly assigned tags. Inherited tags are preserved. Tag names that do not exist yet are created in the project with a default color.","summary":"Replace test run tags","parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid"},"description":"A UUID string identifying this test run.","required":true}],"tags":["Test runs"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V2RunTagsUpdate"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/V2RunTag"}}}},"description":""},"400":{"description":"Request body failed validation."},"401":{"description":"Authentication credentials were missing or invalid."},"404":{"description":"Resource not found."}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.bugbug.io/public-api-reference/test-runs.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
