import type { AuthManifest } from "@empiricalrun/shared-types/auth-manifest"; import { Node, SourceFile } from "ts-morph"; import { type PlaywrightConfig } from "./config"; export declare const AUTH_MANIFEST_RELATIVE_PATH = ".empirical/auth-manifest.json"; export type { AuthManifest }; export declare const getTestModuleAliasFromSourceFile: (sourceFile: SourceFile) => string; export declare function getTestCaseNode({ filePath, scenarioName, suites, repoDir, }: { filePath: string; scenarioName: string; suites?: string[]; repoDir: string; }): Promise<{ testCaseNode: Node | undefined; sourceFile: SourceFile; }>; export declare function getDescribeBlockName(node: Node): string | undefined; /** * The outermost serial `test.describe` enclosing a test, or undefined when the * test is in none. * * Outermost, not innermost: Playwright runs and retries a serial suite as one * unit together with everything nested in it, so a serial block inside a * serial block is part of the outer one. The shard planner groups on the same * outermost suite (`playwright_serial` groups). */ export declare function findOutermostSerialDescribeBlock(node: Node | undefined): Node | undefined; export declare function hasTopLevelDescribeConfigureWithSerialMode(filePath: string): Promise; export { filterArrayByGlobMatchersSet } from "../glob-matcher"; export declare class NoProjectsMatchError extends Error { constructor(); } export declare const generateProjectFilters: ({ filteringSets, repoDir, }: { filteringSets: string[]; repoDir: string; }) => Promise; export type SetupPlan = { setupProjects: string[]; teardownBySetup: Record; storageStateFiles: string[]; }; /** * Finds the setup dependencies of the selected leaf projects, including the * dependencies of those setups, each one's teardown project, and string * storage-state files used by the selected leaf projects. */ export declare function getSetupPlanForLeaves(repoDir: string, leafProjectNames: string[]): Promise; export declare function getUnsupportedConfigReason(config: PlaywrightConfig, teardownProjects: string[]): string | null; export declare function getUnsupportedBrowserReason(config: PlaywrightConfig, projectNames: string[]): string | null; export declare function writeAuthManifest(repoDir: string, manifest: AuthManifest): void; export declare function toTagPatterns(tags: string[]): string[]; /** * Patterns OR-ed into one regex for a single `--grep` / `--grep-invert` * argument, each matched literally. Playwright keeps only the last of repeated * grep flags, which is why they are joined rather than repeated. */ export declare function toGrepAlternation(patterns: string[]): string; export type TagSelection = { tags: string[]; excludeTags: string[]; }; /** * The projects with at least one test the run's tag selection keeps — the tag * analogue of a test-list's `[project]` prefixes, answered by Playwright * itself (`--list --grep` / `--grep-invert`), because the config alone cannot * map a tag to the projects whose tests carry it. * * Null means "could not answer", and the caller falls back to the full setup * plan — over-running setup is recoverable, skipping one the run needs is * not. An **empty set is a real answer**: nothing matches, so nothing needs * setup. Playwright reports that case as an error ("no tests found"), which * is why the catch inspects the output before deciding which of the two it * saw. */ export declare function getProjectsMatchingTags(repoDir: string, projectFilters: string[], selection: TagSelection, envOverrides?: Record): Set | null; /** * The setup projects whose every test passed. * * This mirrors Playwright's own rule for whether a project's dependents may * run. From `createRunTestsTask`: * * const hasFailedDeps = project.deps.some(p => !successfulProjects.has(p)); * if (!hasFailedDeps) phaseTestGroups.push(...testGroups); * ... * if (!hasFailedDeps && !projectSuite.allTests().some(test => !test.ok())) * successfulProjects.add(project); * * Success is per *project* and means every test in it was ok — not that its * storage-state file exists. A setup project can write its state in one test * and fail in the next; Playwright still refuses to run its dependents, and so * must we, or we report green for tests whose setup failed. * * The attribution is Playwright's, not ours. The run has just written * `.last-run.json`, whose `failedTests` is literally * `allTests().filter(t => !t.ok()).map(t => t.id)`, and `--last-failed --list` * resolves those ids back to `[project] › file › title` lines. * * GOTCHA: the listing must use the *same* `--project` filter as the run. Test * ids are derived per filtered project set, so a different filter matches * nothing at all — and says so only as "No tests found". */ export declare function getSuccessfulSetupProjects(repoDir: string, setupProjects: string[], hasTestPassed: boolean, envOverrides?: Record): string[]; export declare function getRunnableLeafProjects(repoDir: string, leafProjectNames: string[], { successfulSetupProjects, restoredStorageStateFiles, }: { successfulSetupProjects: string[]; restoredStorageStateFiles: string[]; }): Promise; export declare function classifyDroppedLeaves(repoDir: string, droppedLeaves: string[], { successfulSetupProjects, skippedSetupProjects, }: { successfulSetupProjects: string[]; skippedSetupProjects: string[]; }): Promise<{ narrowingSkipped: string[]; setupFailed: string[]; }>; export declare function readAuthManifest(repoDir: string): AuthManifest | null; export declare function getExistingStorageStateFiles(repoDir: string, storageStateFiles: string[]): string[]; export declare const generateProjectFiltersV2: ({ match, ignore, repoDir, }: { match: string[]; ignore: string[]; repoDir: string; }) => Promise; export declare const getTestRunner: () => string; export declare function getTypescriptTestBlock({ scenarioName, suites, content, repoDir, }: { scenarioName: string; suites?: string[]; content: string; repoDir: string; }): { testBlock: string | undefined; testNode: Node | undefined; testAlias: string; sourceFile: SourceFile; }; //# sourceMappingURL=index.d.ts.map