From ec4c93c59fccb83453d538e2d4a71dfc400ba4aa Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Mon, 26 Nov 2018 17:13:01 -0330 Subject: Add JSDoc to closeAllWindowHandlesExcept e2e helper fn --- test/e2e/beta/helpers.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/e2e/beta/helpers.js b/test/e2e/beta/helpers.js index 5e3f45b2..b6fc35e0 100644 --- a/test/e2e/beta/helpers.js +++ b/test/e2e/beta/helpers.js @@ -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} exceptions the list of window handle exceptions + * @param {Array?} windowHandles the full list of window handles + * @returns {Promise} + */ async function closeAllWindowHandlesExcept (driver, exceptions, windowHandles) { exceptions = typeof exceptions === 'string' ? [ exceptions ] : exceptions windowHandles = windowHandles || await driver.getAllWindowHandles() -- cgit