* Changes focus to the active modal dialog, such as those opened by * `window.alert()`, `window.confirm()`, and `window.prompt()`. The returned * promise will be rejected with a * plain error.NoSuchAlertError if there are no open alerts. * * @return {!AlertPromise} The open ale
()
| 2618 | * @return {!AlertPromise} The open alert. |
| 2619 | */ |
| 2620 | alert() { |
| 2621 | const text = this.driver_.execute(new command.Command(command.Name.GET_ALERT_TEXT)) |
| 2622 | const driver = this.driver_ |
| 2623 | return new AlertPromise( |
| 2624 | driver, |
| 2625 | text.then(function (text) { |
| 2626 | return new Alert(driver, text) |
| 2627 | }), |
| 2628 | ) |
| 2629 | } |
| 2630 | } |
| 2631 | |
| 2632 | ////////////////////////////////////////////////////////////////////////////// |