Skip to main content
PUT
Trigger a test run

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
environment
string

Slug of a saved environment to run with (e.g., production, staging). Optional: without it the run uses only the project's variables and the config sent on this request.

build
object

Build information to associate with the test run.

metadata
object

Custom key-value pairs to associate with the test run. Values must be strings or numbers.

environment_variables_overrides
object[]

Environment variables to override for this test run.

playwright_projects_match
string[]

Glob patterns of the Playwright projects to run (e.g. chromium*). Empty means every project. Omit to use the environment's playwright_projects_match; send [] for none.

Pattern: ^[^!]
playwright_projects_ignore
string[]

Glob patterns of the Playwright projects to skip, applied after playwright_projects_match. Omit to use the environment's playwright_projects_ignore; send [] for none.

Pattern: ^[^!]
tags
string[]

Tags selecting the tests to run (e.g. @smoke); a missing @ is added. A test runs when one of its tags contains any of them, so smoke also selects @smoke-nightly. A test title is not a tag: checkout flow matches no test. To run specific tests, use test_case_ids. Omit to use the environment's tags; send [] for none.

exclude_tags
string[]

Tags whose tests are skipped (e.g. @slow). Applied after every other selection, so it can only remove tests: with tags it runs tests matching tags but not exclude_tags; alone it runs every test except the excluded ones. Omit to use the environment's exclude_tags; send [] for none.

test_case_ids
string[]

Specific test case ids (Playwright per-project test.id, e.g. 1bd02eced4141fc31282-084163cf0ce372bd31e7) to run. Only these tests will be executed.

Pattern: ^[0-9a-f]{20}-[0-9a-f]{20}
branch
string

Existing test-repository branch to run. A missing explicit branch creates an errored run; Empirical never creates it. May be supplied alongside build, which describes the application code under test.

trigger
object

The application pull request under test, for pre-merge runs. The run uses the test-repository branch named pull_request.head, merged into the project default branch. If no such branch exists, it uses the default branch. An explicit branch takes precedence.

concurrency
object | null

Concurrency group and policy for this run. Runs in the same group (within the project) are limited to one in progress; on_conflict says what this run does when the group already has an active run: cancel cancels it and starts now, wait queues behind it (a newer waiting run replaces an older one). Omit to use the project's legacy concurrency setting; null for no limit.

reporters
object[]

Reporters for this run, saved on the run when it is created; at most one entry per reporter_type. Omit to use the environment's reporter_config (a run without an environment then gets none). A list replaces those defaults: reporters not listed do not fire, and [] turns them all off. Without reporters, a run started by a person (dashboard, CLI or agent session) also gets slack_creator_dm; a list sends the DM only if it names slack_creator_dm. Invalid entries (unknown Slack channels, duplicate types) reject the request without creating a run.

rerun_source_id
integer

ID of the test run this run is a rerun of.

Required range: x >= 1
rerun_only_failed
boolean

When rerunning, only re-execute the previously failed tests.

Response

The triggered test run.

data
object
required