MCPcopy
hub / github.com/codeceptjs/CodeceptJS / closeCurrentTab

Method closeCurrentTab

lib/helper/Playwright.js:1906–1914  ·  view source on GitHub ↗

* Close current tab and switches to previous. * * ```js * I.closeCurrentTab(); * ```

()

Source from the content-addressed store, hash-verified

1904 * ```
1905 */
1906 async closeCurrentTab() {
1907 if (this.isElectron) {
1908 throw new Error('Cannot close current tab inside an Electron container')
1909 }
1910 const oldPage = this.page
1911 await this.switchToPreviousTab()
1912 await oldPage.close()
1913 return this._waitForAction()
1914 }
1915
1916 /**
1917 * Close all tabs except for the current one.

Callers

nothing calls this directly

Calls 2

switchToPreviousTabMethod · 0.95
_waitForActionMethod · 0.95

Tested by

no test coverage detected