import { AnswersQuestions , Interaction , Question , UsesAbilities } from '@serenity-js/core' ; import { formatted } from '@serenity-js/core/lib/io' ; import { AlertPromise } from 'selenium-webdriver' ; desc Instructs the  {@link @serenity-js/core/lib/screenplay/actor~Actor} to
 *  dismiss a  ModalDialog .
 *
 *  example example example extends serenity-js see Accept see ModalDialog export class Dismiss extends Interaction { desc Instantiates this  {@link @serenity-js/core/lib/screenplay~Interaction} *  with a  ModalDialog . window the  {@link @serenity-js/core/lib/screenplay/actor~Actor} *  will dismiss.
     *
     *  param { serenity-js returns { serenity-js see ModalDialog . window see {@link @serenity-js/core/lib/screenplay~Question} static the ( modalDialogWindow ) { return new Dismiss ( modalDialogWindow ) ; } param { serenity-js see ModalDialog . window constructor ( private readonly modalDialogWindow ) { super ( ) ; } desc Makes the provided  {@link @serenity-js/core/lib/screenplay/actor~Actor} *  perform this  {@link @serenity-js/core/lib/screenplay~Interaction} .
     *
     *  param { UsesAbilities & AnswersQuestions } actor An  {@link @serenity-js/core/lib/screenplay/actor~Actor} to perform this  {@link @serenity-js/core/lib/screenplay~Interaction} returns { PromiseLike < void > } see {@link @serenity-js/core/lib/screenplay/actor~Actor} see {@link @serenity-js/core/lib/screenplay/actor~UsesAbilities} see {@link @serenity-js/core/lib/screenplay/actor~AnswersQuestions} performAs ( actor ) { return actor . answer ( this . modalDialogWindow ) . then ( alert => alert . dismiss ( ) ) ; } desc Generates a description to be used when reporting this  {@link @serenity-js/core/lib/screenplay~Activity} .
     *
     *  returns { string } toString ( ) { return formatted `#actor dismisses ${ this . modalDialogWindow }` ; } }