Implement AlertPromise

Hierarchy

Constructors

Properties

[toStringTag]: string

Methods

  • Accepts this alert.

    Returns Promise<void>

    A promise that will be resolved when this command has completed.

  • Sets the username and password in an alert prompting for credentials (such as a Basic HTTP Auth prompt). This method will implicitly #accept() submit the dialog.

    Parameters

    • username: string

      The username to send.

    • password: string

      The password to send.

    Returns Promise<void>

    A promise that will be resolved when this command has completed.

  • Attaches a callback for only the rejection of the Promise.

    Type Parameters

    • TResult = never

    Parameters

    • Optional onrejected: null | ((reason) => TResult | PromiseLike<TResult>)

      The callback to execute when the Promise is rejected.

    Returns Promise<Alert | TResult>

    A Promise for the completion of the callback.

  • Dismisses this alert.

    Returns Promise<void>

    A promise that will be resolved when this command has completed.

  • Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The resolved value cannot be modified from the callback.

    Parameters

    • Optional onfinally: null | (() => void)

      The callback to execute when the Promise is settled (fulfilled or rejected).

    Returns Promise<Alert>

    A Promise for the completion of the callback.

  • Retrieves the message text displayed with this alert. For instance, if the alert were opened with alert('hello'), then this would return 'hello'.

    Returns Promise<string>

    A promise that will be resolved to the text displayed with this alert.

  • Sets the response text on this alert. This command will return an error if the underlying alert does not support response text (e.g. window.alert and window.confirm).

    Parameters

    • text: string

      The text to set.

    Returns Promise<void>

    A promise that will be resolved when this command has completed.

  • Attaches callbacks for the resolution and/or rejection of the Promise.

    Type Parameters

    • TResult1 = Alert

    • TResult2 = never

    Parameters

    • Optional onfulfilled: null | ((value) => TResult1 | PromiseLike<TResult1>)

      The callback to execute when the Promise is resolved.

    • Optional onrejected: null | ((reason) => TResult2 | PromiseLike<TResult2>)

      The callback to execute when the Promise is rejected.

    Returns Promise<TResult1 | TResult2>

    A Promise for the completion of which ever callback is executed.

Generated using TypeDoc