Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
test(bidi): update test expectations (#38908)
Holger Benlb08a8f395f7b
diff --git a/tests/library/capabilities.spec.ts b/tests/library/capabilities.spec.tsindex ac099de045..fa7eba2a28 100644--- a/tests/library/capabilities.spec.ts+++ b/tests/library/capabilities.spec.ts@@ -69,7 +69,6 @@ it('should respect CSP @smoke', async ({ page, server }) => {it('should play video @smoke', async ({ page, asset, browserName, isWindows, isLinux, mode }) => {it.skip(browserName === 'webkit' && isWindows, 'passes locally but fails on GitHub Action bot, apparently due to a Media Pack issue in the Windows Server');- it.fixme(browserName === 'firefox' && isLinux, 'https://github.com/microsoft/playwright/issues/5721');it.skip(mode.startsWith('service'));// Safari only plays mp4 so we test WebKit with an .mp4 clip.diff --git a/tests/library/download.spec.ts b/tests/library/download.spec.tsindex 679411873c..2ad642b9cc 100644--- a/tests/library/download.spec.ts+++ b/tests/library/download.spec.ts@@ -624,8 +624,9 @@ it('should be able to download a inline PDF file via response interception', asyawait page.close();});-it('should be able to download a inline PDF file via navigation', async ({ browser, server, asset, browserName, isHeadlessShell }) => {+it('should be able to download a inline PDF file via navigation', async ({ browser, server, asset, browserName, isHeadlessShell, isBidi }) => {it.skip(browserName === 'chromium' && !isHeadlessShell, 'We expect PDF Viewer to open up in headed Chromium');+ it.skip(browserName === 'firefox' && isBidi, 'We expect PDF Viewer to open up in Firefox with Bidi');const page = await browser.newPage();await page.goto(server.EMPTY_PAGE);diff --git a/tests/library/permissions.spec.ts b/tests/library/permissions.spec.tsindex 6965554b40..3a7238af38 100644--- a/tests/library/permissions.spec.ts+++ b/tests/library/permissions.spec.ts@@ -30,7 +30,7 @@ it.describe('permissions', () => {expect(await getPermission(page, 'geolocation')).toBe('prompt');});- it('should deny permission when not listed', async ({ page, context, server, browserName, isMac, macVersion }) => {+ it('should deny permission when not listed', async ({ page, context, server, browserName, isMac, macVersion, isBidi }) => {it.skip(browserName === 'webkit' && isMac && macVersion === 13, 'WebKit on macOS 13 is frozen.');it.skip(hostPlatform.startsWith('debian11'), 'WebKit on Debian 11 is frozen.');@@ -42,16 +42,21 @@ it.describe('permissions', () => {// permission value, if the API has been accessed.await page.evaluate(() => navigator.geolocation.getCurrentPosition(() => { }));expect(await getPermission(page, 'geolocation')).toBe('denied');+ } else if (isBidi) {+ expect(await getPermission(page, 'geolocation')).toBe('prompt');} else {expect(await getPermission(page, 'geolocation')).toBe('denied');}});- it('should fail when bad permission is given', async ({ page, context, server }) => {+ it('should fail when bad permission is given', async ({ page, context, server, isBidi }) => {await page.goto(server.EMPTY_PAGE);let error: Error;await context.grantPermissions(['foo'], { origin: server.EMPTY_PAGE }).catch(e => error = e);- expect(error.message).toContain('Unknown permission: foo');+ if (isBidi)+ expect(error.message).toContain('Protocol error (permissions.setPermission): invalid argument');+ else+ expect(error.message).toContain('Unknown permission: foo');});it('should grant geolocation permission when origin is listed', async ({ page, context, server }) => {@@ -112,7 +117,7 @@ it.describe('permissions', () => {expect(await getPermission(page, 'geolocation')).toBe('prompt');});- it('should trigger permission onchange', async ({ page, context, server, browserName, browserMajorVersion }) => {+ it('should trigger permission onchange', async ({ page, context, server, browserName, isBidi }) => {it.fail(browserName === 'webkit');await page.goto(server.EMPTY_PAGE);@@ -125,16 +130,21 @@ it.describe('permissions', () => {};});});- expect(await page.evaluate(() => window['events'])).toEqual(['prompt']);+ const expectedEvents = ['prompt'];+ expect(await page.evaluate(() => window['events'])).toEqual(expectedEvents);await context.grantPermissions([], { origin: server.EMPTY_PAGE });- expect(await page.evaluate(() => window['events'])).toEqual(['prompt', 'denied']);+ if (!isBidi)+ expectedEvents.push('denied');+ expect(await page.evaluate(() => window['events'])).toEqual(expectedEvents);await context.grantPermissions(['geolocation'], { origin: server.EMPTY_PAGE });- expect(await page.evaluate(() => window['events'])).toEqual(['prompt', 'denied', 'granted']);+ expectedEvents.push('granted');+ expect(await page.evaluate(() => window['events'])).toEqual(expectedEvents);await context.clearPermissions();- expect(await page.evaluate(() => window['events'])).toEqual(['prompt', 'denied', 'granted', 'prompt']);+ expectedEvents.push('prompt');+ expect(await page.evaluate(() => window['events'])).toEqual(expectedEvents);});- it('should isolate permissions between browser contexts', async ({ server, browser, browserName, isMac, macVersion }) => {+ it('should isolate permissions between browser contexts', async ({ server, browser, browserName, isMac, macVersion, isBidi }) => {it.skip(browserName === 'webkit' && isMac && macVersion === 13, 'WebKit on macOS 13 is frozen.');it.skip(hostPlatform.startsWith('debian11'), 'WebKit on Debian 11 is frozen.');@@ -155,6 +165,8 @@ it.describe('permissions', () => {// permission value, if the API has been accessed.await page.evaluate(() => navigator.geolocation.getCurrentPosition(() => { }));expect(await getPermission(page, 'geolocation')).toBe('denied');+ } else if (isBidi) {+ expect(await getPermission(page, 'geolocation')).toBe('prompt');} else {expect(await getPermission(page, 'geolocation')).toBe('denied');}diff --git a/tests/page/page-focus.spec.ts b/tests/page/page-focus.spec.tsindex b7212539e1..7f239ae5e3 100644--- a/tests/page/page-focus.spec.ts+++ b/tests/page/page-focus.spec.ts@@ -109,7 +109,7 @@ it('should traverse only form elements', async function({ page, browserName, pla});it('clicking checkbox should activate it', async ({ page, browserName, headless, platform }) => {- it.fixme(browserName !== 'chromium');+ it.fixme(browserName === 'webkit');await page.setContent(`<input type=checkbox></input>`);await page.click('input');diff --git a/tests/page/page-wait-for-load-state.spec.ts b/tests/page/page-wait-for-load-state.spec.tsindex 10601b7cef..b23754b84b 100644--- a/tests/page/page-wait-for-load-state.spec.ts+++ b/tests/page/page-wait-for-load-state.spec.ts@@ -70,7 +70,7 @@ it('should work with pages that have loaded before being connected to', async ({expect(popup.url()).toBe(server.EMPTY_PAGE);});-it('should wait for load state of empty url popup', async ({ page, browserName }) => {+it('should wait for load state of empty url popup', async ({ page, browserName, isBidi }) => {const [popup, readyState] = await Promise.all([page.waitForEvent('popup'),page.evaluate(() => {@@ -79,8 +79,8 @@ it('should wait for load state of empty url popup', async ({ page, browserName }}),]);await popup.waitForLoadState();- expect(readyState).toBe(browserName === 'firefox' ? 'uninitialized' : 'complete');- expect(await popup.evaluate(() => document.readyState)).toBe(browserName === 'firefox' ? 'uninitialized' : 'complete');+ expect(readyState).toBe(browserName === 'firefox' && !isBidi ? 'uninitialized' : 'complete');+ expect(await popup.evaluate(() => document.readyState)).toBe(browserName === 'firefox' && !isBidi ? 'uninitialized' : 'complete');});it('should wait for load state of about:blank popup ', async ({ page }) => {