Skip to content

Commit

Permalink
fix: issues with windowactive
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Mucha <[email protected]>
  • Loading branch information
drptbl committed Sep 3, 2021
1 parent ac329b7 commit 1ac495c
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions commands/puppeteer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -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 () => {
Expand Down

0 comments on commit 1ac495c

Please sign in to comment.