ReferenceRunners

What is sent to runners

What Endform copies to the remote machines automatically, and how to send the environment variables and files your tests need.

When you run your tests with Endform, they are packaged, uploaded and scheduled on many remote machines. A test on a remote machine cannot see your laptop, so anything your tests depend on has to travel with them:

  • an environment variable that holds the URL of your preview environment
  • a file with authentication state (storageState in your Playwright config)
  • an image used as a screenshot reference

Endform detects and transfers the common cases. Run endform test --debug to see exactly which files and environment variables it sends.

Automatically transferred state

  • JS and TS files and dependencies: every file your tests import, including package.json, tsconfig.json and node_modules.
  • Your Playwright config, see Requirements for supported options.
  • storageState files listed in your Playwright config.

Environment variables

Environment variables are often sensitive, so only some are transferred:

VariableTransferred
Starts with E2E_Always
Used as process.env.NAME in your Playwright config, your tests or files they importAlways
CIAlways
OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_HEADERS, PLAYWRIGHT_TRACE_API_ENDPOINT and PLAYWRIGHT_TRACE_API_HEADERSAlways
Captured by named groups in a webServer wait patternAlways
AI_GATEWAY_API_KEY, when your tests import Playwright IntentAlways
Anything elseOnly when listed in environmentVariables

The values are read while your playwright.config.ts runs, so loading a .env file with dotenv in your config works. An exclusion pattern in environmentVariables, such as "!CI", keeps a variable out even when a row above sends it.

Send more files and variables

  1. Create an Endform config

    Add endform.config.ts next to your Playwright config.

  2. List what the tests need

    endform.config.ts
    import { defineEndformConfig } from "endform";
    
    export default defineEndformConfig({
      environmentVariables: ["STRIPE_TEST_KEY"],
      additionalFiles: ["fixtures/**/*.png"],
    });
  3. Check what is sent

    npx endform@latest test --debug

See environmentVariables and additionalFiles for every detail of the two options.

Last updated