Implement AlertPromise

### Hierarchy

- Promise<Alert>
- Alert
  - AlertPromise

## Index

### Constructors

- constructor

### Properties

- [toStringTag]

### Methods

- accept
- authenticateAs
- catch
- dismiss
- finally
- getText
- sendKeys
- then

## Constructors

### constructor

- new AlertPromise(driver: WebDriver, alert: Promise<Alert>): AlertPromise

- Inherited from Alert.constructor

  #### Parameters

  - ##### driver: WebDriver

    The driver controlling the browser this alert is attached to.

  - ##### alert: Promise<Alert>

    A thenable that will be fulfilled with the promised alert.

  #### Returns AlertPromise

## Properties

### Readonly [toStringTag]

[toStringTag]: string

Inherited from Promise.__@toStringTag@91

## Methods

### accept

- accept(): Promise<void>

- Inherited from Alert.accept

  Accepts this alert.

  #### Returns Promise<void>

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

### authenticateAs

- authenticateAs(username: string, password: string): Promise<void>

- Inherited from Alert.authenticateAs

  Sets the username and password in an alert prompting for credentials (such as a Basic HTTP Auth prompt). This method will implicitly {@linkplain #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.

### catch

- catch<TResult>(onrejected?: (reason: any) => TResult | PromiseLike<TResult>): Promise<Alert | TResult>

- Inherited from Promise.catch

  Attaches a callback for only the rejection of the Promise.

  #### Type parameters

  - #### TResult = never

  #### Parameters

  - ##### Optional onrejected: (reason: any) => TResult | PromiseLike<TResult>

    The callback to execute when the Promise is rejected.

    - - (reason: any): TResult | PromiseLike<TResult>

      - #### Parameters

        - ##### reason: any

        #### Returns TResult | PromiseLike<TResult>

  #### Returns Promise<Alert | TResult>

  A Promise for the completion of the callback.

### dismiss

- dismiss(): Promise<void>

- Inherited from Alert.dismiss

  Dismisses this alert.

  #### Returns Promise<void>

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

### finally

- finally(onfinally?: () => void): Promise<Alert>

- Inherited from Promise.finally

  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: () => void

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

    - - (): void

      - #### Returns void

  #### Returns Promise<Alert>

  A Promise for the completion of the callback.

### getText

- getText(): Promise<string>

- Inherited from Alert.getText

  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.

### sendKeys

- sendKeys(text: string): Promise<void>

- Inherited from Alert.sendKeys

  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.

### then

- then<TResult1, TResult2>(onfulfilled?: (value: Alert) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>): Promise<TResult1 | TResult2>

- Inherited from Promise.then

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

  #### Type parameters

  - #### TResult1 = Alert

  - #### TResult2 = never

  #### Parameters

  - ##### Optional onfulfilled: (value: Alert) => TResult1 | PromiseLike<TResult1>

    The callback to execute when the Promise is resolved.

    - - (value: Alert): TResult1 | PromiseLike<TResult1>

      - #### Parameters

        - ##### value: Alert

        #### Returns TResult1 | PromiseLike<TResult1>

  - ##### Optional onrejected: (reason: any) => TResult2 | PromiseLike<TResult2>

    The callback to execute when the Promise is rejected.

    - - (reason: any): TResult2 | PromiseLike<TResult2>

      - #### Parameters

        - ##### reason: any

        #### Returns TResult2 | PromiseLike<TResult2>

  #### Returns Promise<TResult1 | TResult2>

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

Generated using TypeDoc