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

# Run Automated Tests

> Launches the built‑in regression‑test suite against a target wallet platform and returns a human‑readable report.

> `GET` /tbs/test

Each call starts a **fresh** test run. Two identical requests will both execute the full suite, so the operation is **not idempotent**.

### Query Parameters (required)

| Name                      | Type     | Description                                                                                                                                      |
| ------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| \`authorization\_header\` | `string` | Value forwarded as the HTTP `X-Auth-Token` header when the test engine talks to the target platform. Example: `5QhbQdQr4EMMNnY79qNPhJEUpXv3vdvp` |
| \`base\_url\`             | `string` | Root URL of the platform under test (scheme + host + optional port). Example: `https://wallet.dev.example.com`                                   |
| \`player\_token\`         | `string` | Token that the test engine will exchange for a player session (`/session` endpoint).                                                             |
| \`currency\`              | `string` | ISO‑4217 code used when creating transactions during the test run.                                                                               |
| \`game\_uuid\`            | `string` | Game identifier passed to `/session`, `/credit-debit`, `/debit`, etc.                                                                            |

***

### Response `200 OK`

| Name | Type     | Description                                                     |
| ---- | -------- | --------------------------------------------------------------- |
| \`\` | `string` | Multi‑line text summarising every scenario. Format shown below. |

```http theme={null}
GET /tbs/test?authorization_header=5QhbQdQr4EMMNnY79qNPhJEUpXv3vdvp&base_url=https://wallet.dev.example.com&player_token=abcd1234&currency=USD&game_uuid=b23e45a7-9be8-d312-56a4-174000426614
```

```text theme={null}
──────── API TEST REPORT ────────
Credit Rollback            | PASSED |
Credit-Debit (Spin)        | PASSED |
Credit-Debit (Purchase)    | PASSED |
Credit and Debit           | PASSED |
Tournament Prize           | PASSED |
──────────────────────────────────
```

***

### Error Handling

If the request is malformed (missing parameter, empty string, etc.) the service returns:

| HTTP Status | Body                                                                                                  | Meaning                                                     |
| ----------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- |
| \`500\`     | `{ "error_code": "INVALID_PARAMETER", "message": "base_url must not be blank" }`                      | Validation failed before any tests were started.            |
| \`500\`     | `{ "error_code": "NOT_AUTHORIZED" }`                                                                  | The caller is not permitted to invoke the test runner.      |
| \`500\`     | `{ "error_code": "ENGINE_FAILURE", "message": "NullPointerException at CreditRollbackWorkflowTest" }` | An unexpected exception occurred while executing the suite. |

***
