diff --git a/tests/bidi/expectations/moz-firefox-nightly-page.txt b/tests/bidi/expectations/moz-firefox-nightly-page.txt index 751f1cd01f748..dc96e4a411a94 100644 --- a/tests/bidi/expectations/moz-firefox-nightly-page.txt +++ b/tests/bidi/expectations/moz-firefox-nightly-page.txt @@ -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] diff --git a/tests/page/page-screenshot.spec.ts b/tests/page/page-screenshot.spec.ts index d7f010f9a691c..3cfbd8efb04ad 100644 --- a/tests/page/page-screenshot.spec.ts +++ b/tests/page/page-screenshot.spec.ts @@ -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(`
`); + await page.setContent(``); const result = await page.screenshot({ fullPage: true }); expect(result).toBeTruthy(); } { - await page.setContent(``); + await page.setContent(``); 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'); } });