Configuration options

Set every configuration option with its supported values and defaults.

Use this reference when you need a config key's accepted values or default. For a first config and an explanation of apps and targets, start with Configuration.

Config file Link to Config file

Export your config as the default export. The command line looks in the working directory, or loads the path you pass with --config. Relative paths inside the config resolve from its folder. Unknown keys are errors, and optional keys set to undefined count as absent.

retest.config.ts
import { chrome, defineConfig, env } from '@rehearsal-labs/retest'const config = defineConfig({  apps: { web: chrome({ baseUrl: 'http://127.0.0.1:4173' }) },  secrets: { password: env('TASK_APP_PASSWORD') },  timeouts: { test: 30_000 },})export default configdeclare module '@rehearsal-labs/retest' {  interface Register {    config: typeof config  }}

This config gives tests one web app and a password reference. Registering its type makes the declared names available to TypeScript in test files. Retest also validates the config when it loads; defineConfig itself preserves types without performing that validation.

Top-level keys Link to Top-level keys

KeyDefaultMeaning
appsRequiredNon-empty map of app names to a target or an app with named targets.
defaultAppThe only app, when there is oneApp a test receives as page when it declares no apps.
runsNo combinations declaredList of app-to-target maps for tests using several apps with several targets.
secretsNoneSecret sources by name, from env(name) or a function.
secretOriginsApp base URL origins for browser targetsAdditional destinations per secret. Electron requires explicit http or https origins; native apps require exact bundle ids.
inboxesNoneMailbox readers by name, optionally with extra allowed origins.
testIdsAny string type-checksArray of test ids, or a named map whose values are test ids, for TypeScript checking.
tagsNo catalogueAllowed tag names. The words and, or and not are reserved.
statesNo catalogueNames for saved sign-in states. A test using one still needs a setup that saves it.
locksNone allowedNames of shared resources a test may hold exclusively during a run.
timeoutsBuilt-in budgetsPartial map of budgets in milliseconds.
evaluationNo judgesJudges and limits for AI checks.
diagnosticsCapture on, no strict policyConsole and network capture, limits and failure policy.
recordingOffVideo capture and retention settings.
pixelsAllowedPer-app rules for screenshots and recordings.

App, target, secret, inbox, tag, state and lock names start with a letter and contain letters, digits, underscores or hyphens. An app's targets must all be one kind: web browsers, Electron apps, iOS simulator apps or macOS apps.

Apps and target combinations Link to Apps and target combinations

A standalone target can carry app settings directly. For several targets, put those settings on app({ targets }), outside the target map. A test using one app runs once per target. When two or more of its apps each have several targets, matching entries in runs must name them all.

App keyDefaultMeaning
targetsRequired for app()Non-empty map of target names to target configurations.
baseUrlNoneAbsolute http or https address used to resolve relative navigation. Web apps only.
start.commandNo server startedShell command that starts the app server.
start.readyRequired with starthttp or https address that answers when the server is ready.
start.cwdConfig folderWorking directory for the command, relative to the config folder.
start.timeoutMsSetup budgetPositive whole milliseconds to wait for readiness.

Retest reuses a server that already answers at start.ready; otherwise it starts the command and stops that server after the run. start belongs to the app even when the app has several targets.

Browser targets Link to Browser targets

TargetConstructionExecutable default
Chromiumchromium(options?)executablePath, then RETEST_CHROMIUM.
Chromechrome(options?)Installed Chrome for the chosen channel.
Edgeedge(options?)Installed Edge for the chosen channel.
Firefox{ browser: 'firefox', ... }executablePath, then the pinned cache build, then the macOS installation only at 133.0.3 build 20241209150345. Use retest install firefox for the pinned build.
WebKit{ browser: 'webkit', ... }executablePath, then RETEST_WEBKIT_BUILD.
Target keyDefaultMeaning
browserRequired in a plain objectchromium, chrome, edge, firefox or webkit. Helpers supply it.
headlesstrueRequest a headless browser. Visible-window mode remains unverified.
executablePathSee target tableChromium, Firefox or WebKit path, relative to the config folder. WebKit also accepts its unpacked build folder.
channelstableChrome and Edge only: stable, beta, dev or canary.
viewportNo explicit overridewidth and height in positive whole CSS pixels. Cannot accompany emulate.
emulateNoneNamed device or custom emulation object.
proxy.serverNo proxyhttp, https, socks4 or socks5 proxy address without credentials.
proxy.bypassNoneArray of bypass rules; <-loopback> sends loopback traffic through Chrome's proxy.

Firefox accepts a viewport and pixel ratio but refuses proxies, touch, mobile layout and a custom user agent. WebKit accepts a viewport, pixel ratio and user agent, but refuses proxies, touch and mobile layout. See Browsers before choosing a target.

Emulation values Link to Emulation values

Named devices are Pixel 9, Galaxy S24, iPhone 17 and iPad Pro 11. These emulate screens in desktop browsers. A custom object has the following keys.

KeyDefaultMeaning
viewport.width, viewport.heightRequiredPositive whole CSS pixels.
deviceScaleFactorRequiredPositive pixel ratio.
touchRequiredWhether the page has a touch screen.
isMobilefalseWhether to use mobile layout behaviour.
userAgentBrowser's ownUser agent string exposed to the app.

Native targets Link to Native targets

Native targets use a plain object with platform. They take no baseUrl or browser emulation settings. iOS simulator apps and macOS apps cover executor and machine requirements.

KeyDefaultMeaning
platformRequiredios-simulator or macos.
appPathRequiredPath to the .app bundle, relative to the config folder.
deviceRequired on iOSSimulator device type, such as iPhone 17.
runtimeRequired on iOSiOS runtime version. This release requires 26.5.
argumentsNoneArray of launch arguments.
environmentNoneMap of launch environment variables to strings.
diagnostics.logsstdoutstdout captures the owned app's output; none leaves launch to the executor without an app log.
diagnostics.network.pathNo network sourceMetadata file written by the backend, relative to the config folder.
diagnostics.network.clientRequired with networkios or macos, matching the file's records for this app.

Electron targets Link to Electron targets

electron(options) supplies browser: 'electron'. Retest launches the app afresh for each test and uses its first window. Electron targets take no base URL, proxy or emulation settings.

KeyDefaultMeaning
executablePathRequiredElectron executable, relative to the config folder.
appPathRequiredApp folder or entry file, relative to the config folder.
argsNoneArguments following the app path.
userDataDirFresh temporary folderPersistent app data folder. Each target needs a distinct folder.

Secrets and inboxes Link to Secrets and inboxes

env(name) returns { env: name }; Retest reads that variable once when a run starts. A function source receives { signal } and returns a string or promise each time a fill needs it. Judge credentials use the same source shape.

inboxes.<name> is a reader function, or { messages: reader, origins?: string[] }. The reader receives { signal } and returns messages newest first. A message has subject, from, plain text, codes, links containing url and text, and receivedAt as a Date, ISO string or epoch milliseconds.

Secret fills, inbox codes and inbox links are restricted to app origins plus their declared additional destinations. Read Signing in and secrets and Email codes and links for complete examples.

Timeouts Link to Timeouts

Every budget is a whole number from 1 to 2147483647 milliseconds. Command-line overrides replace the configured budget. An action or matcher's { timeout } can shorten its budget, while the test's remaining time still limits the call.

KeyDefault in millisecondsScope
collection10000Loading one test file.
setup60000Starting a browser, opening pages and waiting for app readiness.
action10000One action.
navigation30000One navigation.
assertion5000One check that waits.
test60000One test, unless it declares its own timeout.
cleanup10000Finishing outstanding commands, failure capture and closing resources.

AI check configuration Link to AI check configuration

Key under evaluationDefaultMeaning
judgesRequiredNon-empty map of judges.
defaultJudgeThe only judge, when there is oneJudge used when a check names none.
timeoutMs30000Check budget, also limited by the test's time left.
judges.<name>.adapterRequiredModule path, package name or evaluator factory.
judges.<name>.credentialsNoneNamed secret sources, resolved in Retest's process.
judges.<name>.optionsEmpty objectJSON options passed to the adapter.
judges.<name>.acceptsRequiredNon-empty list drawn from text, images and frames.
Key under evaluation.limitsDefaultLimit
callsPerTest5Calls per attempt.
callsPerRun100Calls across the run.
concurrentCalls2Calls waiting on judges at once.
maxOutputTokens1000Output tokens per call.
maxInputBytes8000000Input bytes per call.
maxImages4Screenshots per call.
maxImageWidth, maxImageHeight4096 eachImage dimensions.
maxFrames16Recording frames per call, with a separate media cap of 64.
maxDiagnosticRecords200Diagnostic records per call.

Evaluation limits are whole numbers from 1 to 2147483647. They bound requests across the run rather than guaranteeing that a provider accepts that much input or output.

The built-in adapter is @rehearsal-labs/retest/evaluation/ai-sdk. It needs the ai package, the selected provider package and an apiKey credential. Its options are below; AI checks shows a complete configuration.

Adapter optionDefaultMeaning
providerRequiredanthropic, openai or azure.
modelRequiredModel id, or Azure deployment name.
baseURLProvider's public endpointhttps endpoint, or http to localhost, 127.x.x.x or ::1. Azure requires this or resourceName, never both.
resourceNameNoneAzure resource name, as an alternative to baseURL.
apiVersionSDK defaultAzure API version, when supported by that endpoint.
temperature, topPNot sentOptional sampling settings; unsupported settings are recorded.

Console and network capture Link to Console and network capture

Key under diagnosticsDefaultMeaning
capturetrueCollect console and network records within the target's supported scope.
requireCompletefalsePrevent a pass when capture is incomplete.
strict.runtimeErrorsfalseFail for uncaught errors and unhandled rejections.
strict.consoleErrorsfalseFail for errors logged by app code.
strict.transportFailuresfalseFail for transport failures.
strict.httpErrorsfalseFail for responses with status 400 or above.
strict.allowEmpty listSubstrings in messages or addresses that exclude matching records from the policy.

A strict block needs at least one enabled rule. Neither strict nor requireComplete: true can accompany capture: false. Without a strict policy, captured errors do not fail tests.

Key under diagnostics.limitsDefaultLimit per attempt
consoleEntries1000Console messages and runtime errors.
consoleBytes1048576Bytes of console records.
requests1000Request hops.
networkBytes2097152Bytes of network records.
textLength4096Length of each message.
stackFrames20Frames in each recorded stack.

Recording and pixel rules Link to Recording and pixel rules

Key under recordingDefaultMeaning
recordfalseRecord every app whose pixel rules allow it.
appsNo overridesApp-to-boolean map overriding record for individual apps.
requiredfalseRequire complete requested recordings for the run to pass.
keepallall or failures. Recordings used by AI checks remain kept.
fps10Whole frames per second from 1 to 30.
size.width, size.height1280 and 720Even whole pixels from 16 to 4096.
nativeWithholdingfalseWithhold pixels around plain native secret entry until clearance is verified.

pixels.<app>.screenshots and pixels.<app>.recordings each accept allowed or never, defaulting to allowed. Explicitly recording an app that forbids recordings is an error, as is requiring recordings when no app records. RETEST_NATIVE_WITHHOLDING=true or false overrides the native withholding setting.

Recording needs the media process and ffmpeg. Missing required evidence affects the run independently of what each test observed. See Recordings and evidence for setup, pixel withholding and retention.

Next steps Link to Next steps