@override
()
| 778 | |
| 779 | /** @override */ |
| 780 | quit() { |
| 781 | let result = this.execute(new command.Command(command.Name.QUIT)) |
| 782 | // Delete our session ID when the quit command finishes; this will allow us |
| 783 | // to throw an error when attempting to use a driver post-quit. |
| 784 | return promise.finally(result, () => { |
| 785 | this.session_ = Promise.reject( |
| 786 | new error.NoSuchSessionError( |
| 787 | 'This driver instance does not have a valid session ID ' + |
| 788 | '(did you call WebDriver.quit()?) and may no longer be used.', |
| 789 | ), |
| 790 | ) |
| 791 | |
| 792 | // Only want the session rejection to bubble if accessed. |
| 793 | this.session_.catch(function () {}) |
| 794 | |
| 795 | if (this.onQuit_) { |
| 796 | return this.onQuit_.call(void 0) |
| 797 | } |
| 798 | |
| 799 | // Close the websocket connection on quit |
| 800 | // If the websocket connection is not closed, |
| 801 | // and we are running CDP sessions against the Selenium Grid, |
| 802 | // the node process never exits since the websocket connection is open until the Grid is shutdown. |
| 803 | if (this._cdpWsConnection !== undefined) { |
| 804 | this._cdpWsConnection.close() |
| 805 | } |
| 806 | |
| 807 | // Not awaited: the session is already torn down by this point, so |
| 808 | // closing our end of the socket doesn't need to gate quit() completing. |
| 809 | closeBidiConnection(this) |
| 810 | }) |
| 811 | } |
| 812 | |
| 813 | /** @override */ |
| 814 | actions(options) { |
nothing calls this directly
no test coverage detected