Skip to content

Commit

Permalink
mv3 offscreen issue
Browse files Browse the repository at this point in the history
  • Loading branch information
vthomas13 committed Jul 18, 2024
1 parent 2dbdb48 commit aa65cda
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions test/e2e/webdriver/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -1072,14 +1072,19 @@ class Driver {
const windowHandles = await this.driver.getAllWindowHandles();
for (const handle of windowHandles) {
await this.driver.switchTo().window(handle);
const screenshot = await this.driver.takeScreenshot();
await fs.writeFile(
`${filepathBase}-screenshot-${windowHandles.indexOf(handle) + 1}.png`,
screenshot,
{
encoding: 'base64',
},
);
const windowTitle = await this.driver.getTitle();
if (windowTitle !== 'MetaMask Offscreen Page') {
const screenshot = await this.driver.takeScreenshot();
await fs.writeFile(
`${filepathBase}-screenshot-${
windowHandles.indexOf(handle) + 1
}.png`,
screenshot,
{
encoding: 'base64',
},
);
}
}
} catch (e) {
console.error('Failed to take screenshot', e);
Expand Down

0 comments on commit aa65cda

Please sign in to comment.