Accept
Instructs the Actor to accept a ModalDialog.
Extends:
Examples:
<button
data-test="trigger"
onclick="alert('hello!')">Trigger Alert</button>
import { Target } from '@serenity-js/protractor';
import { by } from 'protractor';
class Widget {
static trigger = Target.the('trigger button')
.located(by.css('[data-test="trigger"]'));
}
import { actorCalled } from '@serenity-js/core';
import { Accept, BrowseTheWeb, Click, ModalDialog } from '@serenity-js/protractor';
import { protractor } from 'protractor';
actorCalled('Nick')
.whoCan(BrowseTheWeb.using(protractor.browser))
.attemptsTo(
Click.on(Widget.trigger),
Accept.the(ModalDialog.window()),
);
See also:
Static Method Summary
Static Public Methods | ||
public static |
the(modalDialogWindow: Question<AlertPromise> | AlertPromise): Interaction Instantiates this Interaction with a ModalDialog.window the Actor will accept. |
Constructor Summary
Public Constructor | ||
public |
constructor(modalDialogWindow: Question<AlertPromise> | AlertPromise) |
Method Summary
Public Methods | ||
public |
performAs(actor: UsesAbilities & AnswersQuestions): PromiseLike<void> Makes the provided Actor perform this Interaction. |
|
public |
toString(): string Generates a description to be used when reporting this Activity. |
Static Public Methods
public static the(modalDialogWindow: Question<AlertPromise> | AlertPromise): Interaction source
Instantiates this Interaction with a ModalDialog.window the Actor will accept.
Params:
Name | Type | Attribute | Description |
modalDialogWindow | Question<AlertPromise> | AlertPromise |
Tests:
See:
Public Constructors
public constructor(modalDialogWindow: Question<AlertPromise> | AlertPromise) source
Params:
Name | Type | Attribute | Description |
modalDialogWindow | Question<AlertPromise> | AlertPromise |
Public Methods
public performAs(actor: UsesAbilities & AnswersQuestions): PromiseLike<void> source
Makes the provided Actor perform this Interaction.
Params:
Name | Type | Attribute | Description |
actor | UsesAbilities & AnswersQuestions | An Actor to perform this Interaction |
Returns:
PromiseLike<void> |