1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00

Add JSDoc to closeAllWindowHandlesExcept e2e helper fn

This commit is contained in:
Whymarrh Whitby 2018-11-26 17:13:01 -03:30
parent a9d3c1a87d
commit ec4c93c59f

View File

@ -120,6 +120,13 @@ async function switchToWindowWithTitle (driver, title, windowHandles) {
}
}
/**
* Closes all windows except those in the given list of exceptions
* @param {object} driver the WebDriver instance
* @param {string|Array<string>} exceptions the list of window handle exceptions
* @param {Array?} windowHandles the full list of window handles
* @returns {Promise<void>}
*/
async function closeAllWindowHandlesExcept (driver, exceptions, windowHandles) {
exceptions = typeof exceptions === 'string' ? [ exceptions ] : exceptions
windowHandles = windowHandles || await driver.getAllWindowHandles()