> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qa.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# qatech test-cases

> List and search test cases in your project.

Lists the test cases in your project. Each test case has a UUID that you can pass to `qatech run -c <id>` to execute it.

## Usage

```bash theme={null}
qatech test-cases [options]
```

## Options

| Flag | Short | Description |
| - | - | - |
| `--application <id>` | `-a` | Filter by application short ID (e.g. `app-myapp_Abc123`) |
| `--labels <labels>` | `-l` | Filter by labels (comma-separated, e.g. `smoke,critical`) |
| `--search <query>` | `-s` | Database websearch over name, goal, expected result, steps, and scenario name (quoted phrases, `OR`, `-term`) |
| `--scenario <id>` | | Filter by scenario short ID (includes nested sub-scenarios) |
| `--no-sub-scenarios` | | With `--scenario`, exclude nested sub-scenarios |
| `--enabled <true\|false>` | | Filter by enabled/disabled status |
| `--include-steps` | | Include the step-by-step definition of each test case |
| `--limit <n>` | | Max results per page (default: 100, max: 1000) |
| `--offset <n>` | | Pagination offset (default: 0) |
| `--json` | `-j` | Machine-readable output |
| `--api-key <key>` | | Per-command API key override |
| `--help` | `-h` | Show command help |

`--application`, `--labels`, `--enabled`, `--scenario`, and `--search` are all applied server-side and can be combined. `--search` uses database websearch syntax: unquoted terms are ANDed, `"quoted phrases"` match as a phrase, `OR` is alternation, and `-term` excludes.

## Examples

```bash theme={null}
# List the first 100 test cases
qatech test-cases

# Find login-related tests
qatech test-cases --search "login"

# Quoted phrase, OR, and exclusion
qatech test-cases --search '"create a new canvas"'
qatech test-cases --search "canvas OR rabbit"
qatech test-cases --search "canvas -delete"

# Combine filters
qatech test-cases --enabled true -a app-myapp_Abc123 -l smoke,critical

# Pagination
qatech test-cases --offset 100 --limit 100

# Extract every test case ID
qatech test-cases --json | jq '.testCases[].id'

# Export all test case definitions including steps
qatech test-cases --include-steps --json > test-cases.json
```

## JSON output

```json theme={null}
{
  "testCases": [
    {
      "id": "636a990b-85e7-44c2-8175-58390f2184a3",
      "name": "Login with valid credentials",
      "isEnabled": true,
      "labels": ["smoke", "auth"],
      "references": [
        {
          "kind": "github_pr",
          "key": "#8648",
          "url": "https://github.com/QAdottech/qatech/pull/8648",
          "title": "Add test case labels and typed references"
        }
      ],
      "applicationShortId": "app-myapp_Abc123",
      "applicationName": "My App",
      "goal": "Verify user can log in",
      "expectedResult": "User lands on the dashboard",
      "lastRun": {
        "shortId": "UkxK",
        "status": "COMPLETED",
        "result": "PASSED",
        "completedAt": "2026-02-26T12:00:00Z"
      }
    }
  ],
  "total": 42,
  "limit": 100,
  "offset": 0
}
```

`labels` is a list of label names. `references` is the attached PRs, issues, TMS cases, and chats (`kind`, `key`, `url`, `title`). Text mode still prints labels only.

With `--include-steps`, each test case also contains a `steps` array with the step-by-step definition (`instruction`, plus optional `expectedResult` per step). See [Exporting Test Cases](https://docs.qa.tech/api-reference/exporting-test-cases.md) for how to turn this into a CSV for other test management tools.

Use the `id` field with [`qatech run -c <id>`](https://docs.qa.tech/cli/commands/run).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.