@serenity-js/web
Version:
Serenity/JS Screenplay Pattern library offering a flexible, web driver-agnostic approach for interacting with web-based user interfaces and components, suitable for various testing contexts
38 lines • 1.43 kB
TypeScript
import type { ModalDialog } from './ModalDialog';
/**
* Represent the strategy to use with any upcoming [`ModalDialog`](https://serenity-js.org/api/web/class/ModalDialog/) windows.
*
* ## Learn more
*
* - [`ModalDialog`](https://serenity-js.org/api/web/class/ModalDialog/)
* - [`Page.modalDialog`](https://serenity-js.org/api/web/class/Page/#modalDialog)
*
* @group Models
*/
export declare abstract class ModalDialogHandler {
protected modalDialog: ModalDialog;
protected constructor(modalDialog?: ModalDialog);
/**
* Configures the handler to accept the next JavaScript modal dialog.
*/
abstract acceptNext(): Promise<void>;
/**
* Configures the handler to accept the next JavaScript `prompt``
* with a given `text` value.
*/
abstract acceptNextWithValue(text: string | number): Promise<void>;
/**
* Configures the handler to dismiss the next JavaScript modal dialog.
*/
abstract dismissNext(): Promise<void>;
/**
* Resets the handler to its default state.
*/
abstract reset(): Promise<void>;
/**
* Returns the most recently handled [`ModalDialog`](https://serenity-js.org/api/web/class/ModalDialog/),
* or [`AbsentModalDialog`](https://serenity-js.org/api/web/class/AbsentModalDialog/) when no dialogs have been handled yet.
*/
last(): Promise<ModalDialog>;
}
//# sourceMappingURL=ModalDialogHandler.d.ts.map