@augment-vir/test
Version:
A universal testing suite that works with Mocha style test runners _and_ Node.js's built-in test runner.
21 lines (20 loc) • 797 B
TypeScript
import { type MaybePromise } from '@augment-vir/common';
import { type Download, type Page } from '@playwright/test';
import { type RequireExactlyOne } from 'type-fest';
import { type UniversalTestContext } from '../augments/universal-testing-suite/universal-test-context.js';
/**
* Output from {@link handleNewPageOrDownload}.
*
* @category Internal
*/
export type HandleNewPageOrDownloadResult = RequireExactlyOne<{
newPage: Page;
download: Download;
}>;
/**
* Run the trigger and catch a new page _or_ a new download (sometimes Playwright inconsistently
* chooses on or the other).
*
* @category Internal
*/
export declare function handleNewPageOrDownload(testContext: Readonly<UniversalTestContext>, trigger: () => MaybePromise<void>): Promise<HandleNewPageOrDownloadResult>;