---
title: "Queue test runs for all test cases on a specific app file"
method: POST
path: "/v1/test-cases/run-all"
tags: ["test-cases"]
---

# Queue test runs for all test cases on a specific app file

`POST /v1/test-cases/run-all`

Queue test runs for ALL test cases in your organization on a specific application file.

    **Process:**
    1. Validates that the requested device exists in the devices table with availability=True
    2. Validates that app_file_id belongs to your organization
    3. Fetches all active test cases for your organization (optionally filtered by category)
    4. Creates test_run records for each test case with 'queued' status
    5. Creates job records for the test execution queue

    **Category Filtering:**
    - Optional: Provide category_id to run only test cases in a specific category
    - If category_id is provided, only test cases in that category will be queued
    - If no category_id is provided, all active test cases will be queued

    **Returns:**
    - Links to view each test run at https://app.qualgent.ai/test-runs/{id}
    - Returns count of total test runs created

    **Transaction Handling:**
    - If any job fails, all jobs in the batch are rolled back
    - Ensures data consistency across test_runs and test_jobs_pgqueuer tables

    **Note:**
    - If there are no test cases (or no test cases in the specified category), returns empty jobs array
    - Only active test cases are included

## Headers

- `x-api-key` string

## Request body

- RunAllTestRequest — Request to queue test runs for all test cases on a specific app file
  - `app_file_id` string, required — ID of the uploaded application file to test against all test cases
  - `device` AppRoutersTestCasesDeviceConfig, required — Device configuration for test execution
    - `name` string, required — Device name or identifier
    - `platform` string, required — Device platform
    - `os_version` string, nullable — Operating system version
    - `orientation` string, nullable — Device orientation
    - `sms_enabled` boolean, nullable — Whether the device has SMS capability (e.g. for OTP). Set when user picks an SMS-enabled device.
  - `category_id` string, nullable — Optional category ID to filter test cases. If provided, only test cases in this category will be run.
  - `execution_mode` string, nullable — Execution mode: 'agent' (AI-driven) or 'maestro' (replay cached YAML). Defaults to 'agent'. Tests without cached YAML will automatically fallback to agent mode.

## Response `200`

Test runs successfully queued for all test cases

- RunTestResponse — Response after queuing test runs
  - `success` boolean, required — Whether the operation succeeded
  - `jobs` TestRunLink[], required — Links to created test runs
    - `link` string, required — URL to view test run
  - `warnings` VariableWarning[], nullable — Non-fatal signals about variables supplied on the run. Currently used to report supplied keys that are not declared on the test case and were ignored.
    - `code` string, required — One of: 'undeclared_reference' (step references a name not declared), 'literal_collision' (declaring a new variable turns existing literal `{{x}}` text into a substitution), 'unknown_variable' (run supplied a variable not declared on the test case; dropped silently).
    - `message` string, required — Human-readable explanation

## Other responses

- `400` — Bad request - invalid device or invalid app_file_id
- `401` — Invalid or missing API key
- `422` — Validation Error
- `500` — Internal server error

---

[API](https://skmtc.dev/qualgent/apis/qualgent-api-service.md) · [All operations](https://skmtc.dev/qualgent/apis/qualgent-api-service/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/qualgent/qualgent-api-service/revisions/2372ed4904a6/schema)
