From 83657a1df4450e901463deca872aed61e1e952ac Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Thu, 4 Nov 2021 13:36:04 -0700 Subject: [PATCH] test: skip interception tests in electron (#10056) --- tests/page/page-request-intercept.spec.ts | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/tests/page/page-request-intercept.spec.ts b/tests/page/page-request-intercept.spec.ts index 92dd54fc89..ff5c3cd1ee 100644 --- a/tests/page/page-request-intercept.spec.ts +++ b/tests/page/page-request-intercept.spec.ts @@ -19,7 +19,8 @@ import os from 'os'; import type { Route } from 'playwright-core'; import { expect, test as it } from './pageTest'; -it('should fulfill intercepted response', async ({ page, server }) => { +it('should fulfill intercepted response', async ({ page, server, isElectron }) => { + it.fixme(isElectron, 'error: Browser context management is not supported.'); await page.route('**/*', async route => { const response = await page.request.fetch(route.request()); await route.fulfill({ @@ -54,8 +55,8 @@ it('should fulfill response with empty body', async ({ page, server, browserName expect(await response.text()).toBe(''); }); -it('should override with defaults when intercepted response not provided', async ({ page, server, browserName, browserMajorVersion }) => { - it.skip(browserName === 'chromium' && browserMajorVersion <= 91, 'Fails in Electron that uses old Chromium'); +it('should override with defaults when intercepted response not provided', async ({ page, server, browserName, isElectron }) => { + it.fixme(isElectron, 'error: Browser context management is not supported.'); server.setRoute('/empty.html', (req, res) => { res.setHeader('foo', 'bar'); res.end('my content'); @@ -75,8 +76,8 @@ it('should override with defaults when intercepted response not provided', async expect(response.headers()).toEqual({ }); }); -it('should fulfill with any response', async ({ page, server, browserName, browserMajorVersion, isLinux }) => { - it.skip(browserName === 'chromium' && browserMajorVersion <= 91, 'Fails in Electron that uses old Chromium'); +it('should fulfill with any response', async ({ page, server, isElectron }) => { + it.fixme(isElectron, 'error: Browser context management is not supported.'); server.setRoute('/sample', (req, res) => { res.setHeader('foo', 'bar'); @@ -97,7 +98,8 @@ it('should fulfill with any response', async ({ page, server, browserName, brows expect(response.headers()['foo']).toBe('bar'); }); -it('should support fulfill after intercept', async ({ page, server }) => { +it('should support fulfill after intercept', async ({ page, server, isElectron }) => { + it.fixme(isElectron, 'error: Browser context management is not supported.'); const requestPromise = server.waitForRequest('/title.html'); await page.route('**', async route => { const response = await page.request.fetch(route.request()); @@ -109,7 +111,8 @@ it('should support fulfill after intercept', async ({ page, server }) => { expect(await response.text()).toBe('Woof-Woof' + os.EOL); }); -it('should give access to the intercepted response', async ({ page, server }) => { +it('should give access to the intercepted response', async ({ page, server, isElectron }) => { + it.fixme(isElectron, 'error: Browser context management is not supported.'); await page.goto(server.EMPTY_PAGE); let routeCallback; @@ -131,7 +134,8 @@ it('should give access to the intercepted response', async ({ page, server }) => await Promise.all([route.fulfill({ response }), evalPromise]); }); -it('should give access to the intercepted response body', async ({ page, server }) => { +it('should give access to the intercepted response body', async ({ page, server, isElectron }) => { + it.fixme(isElectron, 'error: Browser context management is not supported.'); await page.goto(server.EMPTY_PAGE); let routeCallback;