playwright-flake-checker
Version:
A tool to check for flaky Playwright tests by running them multiple times and analyzing results.
28 lines (27 loc) • 1.48 kB
TypeScript
/**
* Checks for isolated tests (tests with .only) in the specified test files.
* @param specs - The test files to check.
* @returns {Promise<boolean>} A promise that resolves to true if there are no isolated tests,
* or rejects if there are isolated tests.
*/
export declare const checkForIsolatedTests: (specs: string[]) => Promise<boolean>;
/**
* Fetches and selects Playwright test files from the specified configuration file.
*
* @param playwrightConfigFile - The path to the Playwright configuration file.
* @returns {Promise<SpecOption[] | null>} A promise that resolves to an array of selected test files,
* or null if no test files are found or an error occurs.
* If no test files are selected, it returns an empty array.
*/
export declare const getAndSelectPlaywrightTests: (playwrightConfigFile: string) => Promise<SpecOption[] | null>;
/**
* Runs Playwright tests with the specified configuration and repeat count.
* @param {string[]} specFiles - The test files to run.
* @param {string} playwrightConfig - The path to the Playwright configuration file.
* @param {number} repeatCount - The number of times to repeat each test.
* @returns {Promise<{ success: boolean, output: string }>} A promise that resolves to an object containing the success status and output of the command.
*/
export declare const runPlaywrightTests: (specFiles: string[], playwrightConfig: string, repeatCount: number) => Promise<{
success: boolean;
output: string;
}>;