Test Cases

Create a test case

Creates a saved test case in a workspace. Cases created via the API have API access enabled by default, so they can be triggered immediately with POST /api/triggers/cases/{caseId}/run.

Default targets. apiMobileConfig, apiWebConfig, apiDesktopConfig and apiMultiDeviceConfig can be set at creation, in the same shapes, with the same encrypted tokens and under the same feature gates and validation as PATCH /api/cases/{caseId}, so a mobile case is runnable in one call. A rejected config creates nothing; the trigger's flat device fields belong inside apiMobileConfig.

post/api/cases

Request

Request body

projectIdstring uuid required

ID of the workspace to create the case in.

scenariostring required

Test scenario text (Gherkin, markdown, or plain text).

type'web' | 'mobile' | 'desktop' | 'multi_device'

Test case type. multi_device requires the organization's multi-device feature (403 otherwise).

titlestring

Case title. Defaults to the first line of the scenario.

descriptionstring
format'gherkin' | 'markdown' | 'plain_text'

Scenario format.

startUrlstring uri nullable

Starting URL (web/desktop cases); must be http(s).

directoryIdstring uuid

Optional directory to place the case in. Get IDs from GET /api/directories.

tagsstring[]

Caller-supplied labels, for example the commit and pull request a run was testing. At most 10, each 1-64 characters after trimming; duplicates are collapsed. A request exceeding a bound is refused with 400, never truncated. Tags are returned exactly as stored and are visible to everyone in your organization, so never put secrets in them.

Example request

{
  "tags": [
    "git:sha:3f2c1e9a7b6d5c4e3f2a1b0c9d8e7f6a5b4c3d2e",
    "genesis:pr:1234"
  ]
}

Response

Case created.

successboolean required
caseIdstring uuid required

Example response

{
  "success": true
}

Changes

No recorded changes to this operation across all 1 revision of this API.