API reference
Every symbol re-exported from src/index.ts, grouped by the feature area most users look for first. Generated by scripts/gen-api-reference.mjs — do not edit by hand.
Run npm run docs:api to regenerate. CI fails when this file is out of date.
Start with Browser, By / Locator, and the feature guide that matches the job you are automating.
Browser And Pages
Launch browsers, move between pages and frames, handle dialogs, and wait for navigation.
| Symbol | Kind | Summary | Docs |
|---|---|---|---|
Browser | class | — | browser-api |
LaunchOptions | type | — | browser-api |
LoadState | type | When to consider a navigation complete. - 'load' — page load event has fired (default) - 'domcontentloaded' — DOMContentLoaded has fired (faster, no waiting for images/fonts) - 'networkidle' — load + no in-flight requests for 500 ms - 'none' — do not wait; return as soon as the navigation is initiated | browser-api |
Page | class | — | browser-api |
Frame | class | — | browser-api |
Dialog | type | Represents an open browser dialog (alert / confirm / prompt). Passed to handlers registered with browser.onDialog(). | browser-api |
DialogType | type | The type of a browser dialog. | browser-api |
Download | type | A file downloaded during a waitForDownload() call. | browser-api |
Locators And Elements
Find page content with semantic locators and selector helpers.
| Symbol | Kind | Summary | Docs |
|---|---|---|---|
By | class | — | selectors |
Locator | class | — | selectors |
Input
Drive keyboard, mouse, and low-level key values.
| Symbol | Kind | Summary | Docs |
|---|---|---|---|
Key | const | — | keyboard-mouse |
Keyboard | class | — | keyboard-mouse |
Mouse | class | — | keyboard-mouse |
Contexts And Sessions
Isolate users, manage cookies, and save or restore browser state.
| Symbol | Kind | Summary | Docs |
|---|---|---|---|
BrowserContext | class | — | browser-context |
BrowserContextConfig | type | Per-context options stored at creation time. | browser-context |
BrowserContextHooks | type | Internal hooks the owning {@link Browser } passes to a new context. | browser-context |
ClearCookiesFilter | type | Filter applied to {@link BrowserContext.clearCookies}. | browser-context |
ContextStorageStateOptions | type | Options for {@link BrowserContext.storageState}. | browser-context |
InitScriptHandle | type | A handle returned by {@link BrowserContext.addInitScript}. | browser-context |
RoutePattern | type | Pattern accepted by {@link BrowserContext.route}. Same shape as the browser-level interceptor. | browser-context |
Cookie | type | — | session-management |
CookieInput | type | — | session-management |
SessionState | type | — | session-management |
SessionStateManager | class | — | session-management |
StorageStateOptions | type | — | session-management |
Network
Mock, intercept, observe, and assert browser network traffic.
| Symbol | Kind | Summary | Docs |
|---|---|---|---|
NetworkInterceptor | class | — | network |
MockResponse | type | — | network |
InterceptedRequest | type | — | network |
InterceptedResponse | type | — | network |
Logs And Tracing
Capture console output, JavaScript errors, and trace artifacts.
| Symbol | Kind | Summary | Docs |
|---|---|---|---|
LogMonitor | class | — | browser-logs |
ConsoleMessage | type | — | browser-logs |
JavaScriptError | type | — | browser-logs |
LogMessage | type | — | browser-logs |
TraceStartOptions | type | — | tracing |
TraceScreenshotMode | type | Screenshot mode for tracing. | tracing |
TraceEvent | type | — | tracing |
Emulation And Time
Configure devices, emulation overrides, and deterministic browser time.
| Symbol | Kind | Summary | Docs |
|---|---|---|---|
devices | const | Common mobile device presets | browser-api |
DeviceMetrics | type | Device metrics for custom mobile emulation | browser-api |
DeviceName | type | — | browser-api |
MobileEmulation | type | Mobile emulation configuration | browser-api |
EmulateOptions | type | Options for {@link Browser.emulate}. Every field is independent; only the keys you pass are applied, others stay at their previous value. Passing null for a field clears the override for that field. | browser-api |
Clock | class | Controls the virtual clock inside the browser page. | clock |
ClockInstallOptions | type | Options for {@link Clock.install}. | clock |
ClockTime | type | Accepted forms for a point in time. | clock |
Accessibility
Run axe-core accessibility checks and inspect violation details.
| Symbol | Kind | Summary | Docs |
|---|---|---|---|
A11y | class | Ergonomic wrapper around axe-core. Obtain instances via the .a11y accessor on Browser, ElementHandle, or Locator — never construct directly. | accessibility |
A11yError | class | Thrown by A11y.check() when violations are found. | accessibility |
A11yImpact | type | Severity buckets reported by axe-core. | accessibility |
A11yOptions | type | — | accessibility |
A11yResult | type | — | accessibility |
A11yViolation | type | — | accessibility |
A11yViolationNode | type | — | accessibility |
Errors And Driver Services
Handle stable CraftDriver errors or customize browser driver services.
| Symbol | Kind | Summary | Docs |
|---|---|---|---|
CraftdriverError | class | Base class for every error thrown from the public API. | error-codes |
CraftdriverErrorOptions | type | — | error-codes |
ErrorCode | const | Stable, machine-readable error codes for the public craftdriver API. | error-codes |
ErrorCodeName | type | — | error-codes |
ErrorCodeValue | type | — | error-codes |
ChromeService | class | — | getting-started |
ChromeServiceOptions | type | — | getting-started |
FirefoxService | class | — | getting-started |
FirefoxServiceOptions | type | — | getting-started |
Total exports: 60.