aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/e2e/beta/helpers.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/e2e/beta/helpers.js b/test/e2e/beta/helpers.js
index 5e3f45b2b..b6fc35e08 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<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()