Skip to main content

Configuration

The config lives in intelliwright.config.ts at the project root, and exports a config object, typed with defineConfig:

intelliwright.config.ts
import { defineConfig } from "intelliwright";

export default defineConfig({
testDir: "./e2e",
baseURL: "http://localhost:3000",
webServer: {
command: "npm run dev",
url: "http://localhost:3000",
reuseExistingServer: !process.env.CI,
},
use: { locale: "en-US", timezoneId: "America/New_York" },
retries: process.env.CI ? 2 : 0,
timeout: 60_000,
expect: { timeout: 10_000 },
ai: {
provider: "typesafe",
redact: [/\b\d{4}(?: \d{4}){3}\b/],
},
suites: {
smoke: "@smoke",
nightly: "@regression or @slow",
},
reporters: ["terminal", "html", "junit"],
});

The config file​

  • Intelliwright looks in the current folder for intelliwright.config.ts, then .mts, .cts, .js, .mjs and .cjs. --config <file> picks another.
  • The config's folder is the project root: relative paths in the config resolve against it, and .env.local and then .env are loaded from it before the config. Variables that are already set aren't overwritten.
  • The file can be TypeScript or JavaScript, an ES module or CommonJS. It's loaded without a build step.
  • Without a config file, the defaults below apply, with the current folder as the root.

Tests​

OptionTypeDefaultWhat it does
testDirstring"e2e"The folder with the tests.
testMatchstring | string[]"**/*.e2e.{ts,js,mts,mjs,cts,cjs}"Globs for test files, relative to testDir.
testIgnorestring | string[][]Globs for files to leave out. They apply to setup files too.
outputDirstring"test-results"Where failure artifacts and the last run's state go. Cleared at the start of each run, except in UI mode.

Files in testDir named *.setup.{ts,mts,cts,js,mjs,cjs} hold sign-ins and are never test files.

The app​

OptionTypeDefaultWhat it does
baseURLstringRelative URLs in page.goto, page objects and toHaveURL resolve against it. --base-url overrides it.
webServerobject | object[]Starts the app before the tests and stops it afterwards.
globalSetupstringA module whose default export runs once before the tests. It receives the resolved config and may return a teardown function.
globalTeardownstringA module whose default export runs once after all tests.

webServer options:

OptionTypeDefaultWhat it does
commandstringThe shell command that starts the app.
urlstringResponds with a status from 200 to 403 once the app is ready.
reuseExistingServerbooleanfalseUses a server already responding at url instead of starting one.
timeoutnumber60000Milliseconds to wait for url.
cwdstringThe config's folderWhere command runs.
envRecord<string, string>Extra environment variables for command.
showOutputbooleanfalsePrints the server's output. It's shown anyway if the server fails to start.

See Starting your app.

Browser​

OptionTypeDefaultWhat it does
browser"chromium" | "firefox" | "webkit""chromium"The browser every test runs in.
launchOptionsLaunchOptions{}Passed to Playwright's browserType.launch(), such as channel or slowMo.
headlessbooleantrue--headed turns it off.
useobject{}Browser context options for every test, described below. test.use() sets them for one file or describe.
testIdAttributestring"data-testid"The attribute getByTestId reads, such as data-test or data-cy.

use takes Playwright's browser context options, such as viewport, locale, timezoneId, colorScheme, permissions, geolocation, extraHTTPHeaders, httpCredentials, ignoreHTTPSErrors and storageState, except baseURL, which has its own option. It adds:

OptionTypeDefaultWhat it does
actionTimeoutnumberNo limitMilliseconds for each action, such as click.
navigationTimeoutnumberNo limitMilliseconds for each navigation.
authstring | nullStarts tests signed in as this role, with the state test.auth(role) saved. null starts them signed out.

Running​

OptionTypeDefaultWhat it does
workersnumberHalf the CPU coresWorker processes that run test files in parallel. --workers overrides it.
retriesnumber0Extra attempts for a failing test. --retries overrides it.
timeoutnumber30000Milliseconds for each test, fixtures and hooks included. 0 means no limit. --timeout overrides it.
expect.timeoutnumber5000Milliseconds page and AI assertions keep retrying.
suitesRecord<string, string>{}Named tag expressions, run with --suite <name>.

Jev​

Everything under ai is optional. Without provider, the first provider whose key is set in the environment is used. See Providers.

OptionTypeDefaultWhat it does
ai.providerPreset name, host or functionDetected from the environment"typesafe", "vercel", "openrouter", "cloudflare", a { baseURL } host, or an object with an evaluate function.
ai.modelstringThe preset's modelOverrides the model, for example to pin jev-1.13.0.
ai.apiKeystringFrom the environmentOverrides the key.
ai.baseURLstringThe preset's URLSends requests through another URL, such as a proxy.
ai.fetchtypeof fetchNode's fetchA custom fetch.
ai.timeoutnumber30000Milliseconds per request attempt.
ai.maxRetriesnumber3Retries for timeouts, network errors, 408, 429 and 5xx responses.
ai.maxConcurrencynumber4The most requests in flight per worker.
ai.minProbabilitynumber0.7The probability AI assertions and actions need.
ai.cachebooleantrueCaches resolved locators in .intelliwright/cache.json.
ai.triagebooleantrueAsks Jev to label failures.
ai.redactArray<RegExp | string>[]Masks text before the page state is sent: regular expressions match text, strings are selectors whose elements' text is masked.

Reporting​

OptionTypeDefaultWhat it does
reportersArray<name | [name, options]>["terminal", "html"]Reporters to use: terminal, html, json and junit. --reporter overrides it.
report.open"on-failure" | "always" | "never""on-failure"When the HTML report opens after a local run. It never opens when CI is set.

Reporter options:

ReporterOptionDefault
htmloutputFolder"intelliwright-report"
htmlopenreport.open
jsonoutputFile"test-results/results.json"
junitoutputFile"test-results/junit.xml"

See Reports and artifacts.

Files Intelliwright writes​

PathCommit it?What it holds
test-results/NoFailure artifacts, and .last-run.json for --last-failed.
intelliwright-report/NoThe last HTML report.
.intelliwright/cache.jsonYesLocators resolved by AI actions.
.intelliwright/auth/NeverSaved sign-ins, which hold session cookies.

intelliwright init adds the ones that shouldn't be committed to .gitignore.