Skip to content
Open
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion tests/bidi/expectations/moz-firefox-nightly-page.txt
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ page/page-route.spec.ts › should not throw if request was cancelled by the pag
page/page-screenshot.spec.ts › page screenshot › should allow transparency [fail]
page/page-screenshot.spec.ts › page screenshot animations › should not capture css animations in shadow DOM [flaky]
page/page-screenshot.spec.ts › page screenshot animations › should not capture pseudo element css animation [fail]
page/page-screenshot.spec.ts › should throw if screenshot size is too large [fail]
page/page-set-input-files.spec.ts › should upload a folder [fail]
page/page-wait-for-load-state.spec.ts › should wait for load state of empty url popup [timeout]
page/wheel.spec.ts › should dispatch wheel events after popup was opened @smoke [timeout]
Expand Down
11 changes: 7 additions & 4 deletions tests/page/page-screenshot.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -884,18 +884,21 @@ it.describe('page screenshot animations', () => {
});
});

it('should throw if screenshot size is too large', async ({ page, browserName, isMac }) => {
it('should throw if screenshot size is too large', async ({ page, browserName, isMac, isBidi }) => {
const maxSize = browserName === 'firefox' && isBidi ? 65535 : 32767;
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/16727' });
{
await page.setContent(`<style>body {margin: 0; padding: 0;}</style><div style='min-height: 32767px; background: red;'></div>`);
await page.setContent(`<style>body {margin: 0; padding: 0;}</style><div style='min-height: ${maxSize}px; background: red;'></div>`);
const result = await page.screenshot({ fullPage: true });
expect(result).toBeTruthy();
}
{
await page.setContent(`<style>body {margin: 0; padding: 0;}</style><div style='min-height: 32768px; background: red;'></div>`);
await page.setContent(`<style>body {margin: 0; padding: 0;}</style><div style='min-height: ${maxSize + 1}px; background: red;'></div>`);
const exception = await page.screenshot({ fullPage: true }).catch(e => e);
if (browserName === 'firefox' || (browserName === 'webkit' && !isMac))
if ((browserName === 'firefox' && !isBidi) || (browserName === 'webkit' && !isMac))
expect(exception.message).toContain('Cannot take screenshot larger than 32767');
else if (browserName === 'firefox' && isBidi)
expect(exception.message).toContain('Unable to capture screenshot');
}
});

Expand Down
Loading