Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/page-objects/screenshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,16 @@ export default class ScreenshotPageObject extends BasePageObject {

const permutations = await this.browser.execute(getPermutationSizes);

// Restore window size after taking the screenshot
await this.safeSetWindowSize(originalWindowSize.width, originalWindowSize.height);

if (permutations.length === 0) {
throw new Error('No permutations found on current page.');
}

const screenshot = await this.fullPageScreenshot();
const image = await parsePng(screenshot);

// Restore window size after taking the screenshot
await this.safeSetWindowSize(originalWindowSize.width, originalWindowSize.height);

return permutations.map((permutation: PermutationInfo) => ({ ...permutation, image }));
}

Expand Down
Loading