Skip to content

Commit

Permalink
Fixed failing test on Safari
Browse files Browse the repository at this point in the history
  • Loading branch information
dmester committed May 10, 2024
1 parent 71358d0 commit 5366115
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/e2e/browser/screenshooter.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ async function screenshot(driver) {
width: dimensions.scrollWidth,
height: dimensions.scrollHeight
});

const xnum = Math.ceil(dimensions.scrollWidth / dimensions.innerWidth);
const ynum = Math.ceil(dimensions.scrollHeight / dimensions.innerHeight);

Expand All @@ -23,6 +23,9 @@ async function screenshot(driver) {
window.scrollTo(${x * dimensions.innerWidth}, ${y * dimensions.innerHeight});
return { x: window.scrollX || window.pageXOffset, y: window.scrollY || window.pageYOffset }`)

// Delay for Safari
await driver.sleep(500);

const datauri = await driver.takeScreenshot();
const image = PNG.sync.read(Buffer.from(datauri, "base64"));

Expand Down

0 comments on commit 5366115

Please sign in to comment.