import type { PlaywrightTestConfig } from "@playwright/test"; /** * Finds the NX workspace root by walking up the directory tree looking for nx.json or workspace.json. * * @param startDir - Starting directory for the search (defaults to current working directory) * @returns {string} Absolute path to the workspace root * @throws Error if workspace root cannot be found */ export declare function findWorkspaceRoot(startDir?: string): string; export interface E2EPluginConfig { outputPath?: string; } export interface E2EProjectConfig { testDir?: string; } export interface E2EBehaviorConfig { timeout?: number; retries?: number; navigationTimeout?: number; actionTimeout?: number; /** * Override Playwright's worker count. Useful when the suite hits external, * rate-limited services (Okta `/api/v1/authn` returns `E0000047` once you * fan out past a handful of parallel logins against a shared environment). * * The `login` fixture caches one authenticated `storageState` per worker, * so worker count is effectively the upper bound on parallel Okta calls * per `(baseURL, username)` pair. Capping workers therefore caps Okta load. * * Leave unset to use Playwright's default (`Math.ceil(os.cpus().length / 2)` * locally, `1` on CI). */ workers?: number | string; /** * Whether tests within the same file should run in parallel. * * Defaults to Playwright's behaviour (`undefined`, i.e. the project-level * setting wins, which in turn defaults to `false`). Set explicitly when a * project wants file-level parallelism or wants to opt out of it. */ fullyParallel?: boolean; } export interface E2EConfigOptions { /** * Absolute path to the directory of the calling `playwright.config.ts`. Pass `__dirname`. * * Required when running under `@nx/playwright` (or any executor that forks Playwright from * the workspace root) — without it, `process.cwd()` resolves to the workspace root and * codeowner lookup / report paths land outside the intended project directory. * * When omitted, falls back to `process.cwd()` for backwards compatibility with consumers * invoking Playwright directly from their project directory. */ configDir?: string; nxRoot?: string; outputDirOverride?: string; projectConfig?: E2EProjectConfig; behaviorConfig?: E2EBehaviorConfig; pluginConfig?: E2EPluginConfig; } /** * Creates default Playwright configuration for E2E testing. * Returns a partial `PlaywrightTestConfig` that projects can spread and extend. * * @param options - Optional configuration overrides * @returns {Partial} Playwright test configuration */ export declare const defaultPlaywrightConfig: (options?: E2EConfigOptions) => Partial;