Skip to main content
GET
/
api
/
test-cases
/
v2
List Test Cases
curl --request GET \
  --url https://api.example.com/api/test-cases/v2 \
  --header 'Authorization: <authorization>'
{
  "data": {
    "test_cases": [
      {
        "id": "a30a6eba6312f6b87ea5-55e241fbe3f4b8ae61ee",
        "name": "search works",
        "file_path": "search.spec.ts",
        "suites": ["Search"],
        "playwright_project": "chromium",
        "tags": ["smoke"],
        "created_at": "2026-01-15T10:30:00Z",
        "updated_at": "2026-03-20T14:00:00Z",
        "first_seen_commit_sha": "abc1234",
        "last_seen_commit_sha": "def5678"
      }
    ],
    "pagination": {
      "limit": 100,
      "offset": 0,
      "hasMore": false
    }
  }
}
Returns test cases from the test_cases_v2 table, keyed by Playwright test ID (pw_test_id). Supports filtering by file path, Playwright project, tags, and full-text search.

Request

Authorization
string
required
Bearer token for authentication. Format: Bearer <your-api-key>
project_id
number
required
The project ID.
Text search across test name, file path, and suites.
file_path
string
Filter by file path (prefix match).
playwright_project
string
Filter by Playwright project name (e.g. “chromium”).
tags
string
Comma-separated list of tags to filter by (matches test cases that have any of the specified tags).
first_seen_commit_sha
string
Filter by the commit SHA where the test was first seen.
last_seen_commit_sha
string
Filter by the commit SHA where the test was last seen.
is_active
string
Set to true to return only tests last seen at the most recent sync. Set to false for stale tests.
limit
number
Maximum number of results to return. Default: 100.
offset
number
Number of results to skip for pagination. Default: 0.

Response

data.test_cases
array
List of test cases matching the filters.
data.pagination
object
{
  "data": {
    "test_cases": [
      {
        "id": "a30a6eba6312f6b87ea5-55e241fbe3f4b8ae61ee",
        "name": "search works",
        "file_path": "search.spec.ts",
        "suites": ["Search"],
        "playwright_project": "chromium",
        "tags": ["smoke"],
        "created_at": "2026-01-15T10:30:00Z",
        "updated_at": "2026-03-20T14:00:00Z",
        "first_seen_commit_sha": "abc1234",
        "last_seen_commit_sha": "def5678"
      }
    ],
    "pagination": {
      "limit": 100,
      "offset": 0,
      "hasMore": false
    }
  }
}

Example

curl -X GET \
  "https://dash.empirical.run/api/test-cases/v2?project_id=4&search=login&tags=smoke" \
  -H "Authorization: Bearer $EMPIRICALRUN_KEY"