From 1ac495cd005b49c91aa06a73c6c03a3eb1529c05 Mon Sep 17 00:00:00 2001 From: Jakub Mucha Date: Fri, 3 Sep 2021 22:54:45 +0200 Subject: [PATCH] fix: issues with windowactive Signed-off-by: Jakub Mucha --- commands/puppeteer.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/commands/puppeteer.js b/commands/puppeteer.js index eed22315c..e35f467b3 100644 --- a/commands/puppeteer.js +++ b/commands/puppeteer.js @@ -60,6 +60,7 @@ module.exports = { let pages = await puppeteerBrowser.pages(); const visiblePages = pages.filter(async page => { const state = await page.evaluate(() => document.visibilityState); + // todo: seem to be bugged out with cypress first tab always having visiblityState visible return state === 'visible'; }); const activeTabPage = visiblePages[0]; @@ -85,15 +86,11 @@ module.exports = { } }, switchToCypressWindow: async () => { - if (!(await module.exports.isCypressWindowActive())) { - await mainWindow.bringToFront(); - } + await mainWindow.bringToFront(); return true; }, switchToMetamaskWindow: async () => { - if (!(await module.exports.isMetamaskWindowActive())) { - await metamaskWindow.bringToFront(); - } + await metamaskWindow.bringToFront(); return true; }, switchToMetamaskNotification: async () => {