ReferenceConfigurationendform.config.ts
endform.jsonc (legacy)
Every option of the legacy endform.jsonc and endform.json config files, and how to migrate them to endform.config.ts with npx endform@latest migrate-config.
Endform reads endform.jsonc (JSON with comments) or endform.json when no script config (endform.config.ts, .mts, .js, .mjs or .cjs) is present in the same directory. Where you put the file decides what it applies to:
- In the same folder as your Playwright suite, it applies to that suite.
- In the root of your repository, it applies to every suite in the repository.
Endform searches upward from your Playwright config directory to the nearest .git directory. Within any directory, script configs take precedence over endform.jsonc, which takes precedence over endform.json.
{
"environmentVariables": ["VERCEL_.*"],
"region": "eu"
}Migrate to endform.config.ts
Run npx endform@latest migrate-config in your repository:
npx endform@latest migrate-configPass -c or --config with a Playwright config file or test directory if your suite is not in the current working directory.
The command locates your endform.jsonc or endform.json, writes a matching script config (.ts, .mts, .js, .mjs or .cjs, based on your Playwright config), wraps it with defineEndformConfig when the endform package is installed, and removes the original JSON file. If a script config already exists in that directory, the command stops without overwriting it.
Options
additionalFiles
An array of glob strings. Endform sends the matching files to your test machines, resolved relative to your Playwright config directory.
{
"additionalFiles": ["user-state/*"]
}Files listed in storageState in your Playwright config are sent automatically, so you do not need to list them here. Use this option when your tests depend on other files implicitly.
concurrentTestLimits
Limits how many tests run at the same time. Each item has a scope, an optional label and a limit.
scope is one of:
"within-suite-run": limits concurrent tests within one suite run."across-all-runs": limits concurrent tests across every matching suite run your organization is running. This is a shared, global limit.
label selects the tests the limit applies to:
tag:@my-taglimits tests with that test tag.project:project-namelimits tests in that Playwright project.lock:lock-nameoverrides the default scope or limit for tests sharing a Playwright test lock. By default, tests sharing a lock run one at a time (limit: 1) within a suite run across machines; adding alock:entry lets you raise that limit or apply it"across-all-runs".- Omitted or
null: applies to every test in the run.
limit is the maximum number of tests in that group that can run at the same time. It must be greater than 0.
{
"concurrentTestLimits": [
{ "scope": "within-suite-run", "limit": 20 },
{ "scope": "within-suite-run", "label": "tag:@smoke", "limit": 2 },
{ "scope": "within-suite-run", "label": "lock:payments", "limit": 3 },
{ "scope": "across-all-runs", "label": "project:slow-backend", "limit": 10 }
]
}A test starts only when every limit that applies to it allows it. In this example:
- Within the suite run, 20 tests can run at the same time, at most 2 of them are tagged
@smoke, and up to 3 tests sharing thepaymentslock can run together instead of the default 1. - No more than 10 tests in the
slow-backendproject run at the same time, across every suite run in your organization.
environmentVariables
An array of regular expressions. Endform sends every environment variable whose name matches one of them to the remote runners.
{
"environmentVariables": ["VERCEL_.*"]
}A pattern that starts with ! excludes the variables it matches, even ones Endform would send anyway. Patterns are not anchored, so add ^ and $ to match an exact name:
{
"environmentVariables": ["!^PLAYWRIGHT_BDD_CONFIGS$"]
}Some variables are sent without being listed, such as those that start with E2E_. See What is sent to runners.
extraHttpHeaders
An object that maps header names to string values. Endform adds these headers to the Playwright browser contexts when tests run on remote runners.
{
"extraHttpHeaders": {
"x-custom-auth": "my-secret-token",
"x-bypass-protection": "token-value"
}
}The headers are merged into Playwright's extraHTTPHeaders option, in both the top-level use and each project's use. When your playwright.config.ts sets a header with the same name, the value from your Playwright config wins.
Override with an environment variable
The ENDFORM_EXTRA_HTTP_HEADERS environment variable overrides extraHttpHeaders. Set it to a JSON object of header names and values:
ENDFORM_EXTRA_HTTP_HEADERS='{"x-custom-auth":"env-token"}' npx endform testWhen it is set, it replaces the extraHttpHeaders in endform.jsonc. The two are not merged.
organizationId
The organization this project runs in. The --organization-id flag overrides it. The suite run fails if the authenticated user has no access to the organization.
{
"organizationId": "my-organization-id"
}otlpEndpoint
An OTLP/HTTP traces endpoint. Remote runners export Playwright OpenTelemetry traces to its url, with any headers you set.
{
"otlpEndpoint": {
"url": "https://api.eu1.honeycomb.io/v1/traces",
"headers": { "x-honeycomb-team": "your-api-key" }
}
}When otlpEndpoint or otlpEndpoints is set, Endform configures playwright-opentelemetry on the remote runners and propagates trace headers in browser and application traffic.
Avoid committing API keys or secrets to a static endform.jsonc file. If your tracing provider needs secret headers, migrate to endform.config.ts so you can read them from process.env.
otlpEndpoints
Like otlpEndpoint, but a list, to export traces to more than one place.
{
"otlpEndpoints": [
{ "url": "https://api.eu1.honeycomb.io/v1/traces", "headers": { "x-honeycomb-team": "your-api-key" } },
{ "url": "https://collector.internal.example/v1/traces" }
]
}proxyNetworkHosts
The host names whose HTTP traffic the remote runners send to your CLI. This is the easiest way to test a local web app or API, and works by intercepting HTTP requests in Node and in the browser. The traffic travels encrypted over direct peer-to-peer connections. See Test against a local server.
{
"proxyNetworkHosts": ["*.test.internal-domain", "*.staging.internal-domain", "<loopback>"]
}Each string is a match rule, one of:
- A host name pattern, such as
my-domain.comor*.internal.org - An IP address, such as
127.0.0.1 <loopback>, which matcheslocalhost,*.localhost,127.0.0.1and[::1]
proxyNetworkPorts
The local loopback ports that accept raw TCP connections from the remote runners. Use this for databases and other clients that connect directly to 127.0.0.1:<port>. The traffic travels encrypted over direct peer-to-peer connections. See Test against a local server.
{
"proxyNetworkPorts": [5432, 6379]
}region
The region your tests run in, "eu" or "us". By default, Endform picks the region closest to where the CLI runs. Set it when your test environment is in a different region from your CI jobs.
{
"region": "eu"
}Last updated