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: use custom header when testing header removal (#4157)
Yury Semikhatskyfec37adf68ce
diff --git a/test/page-route.spec.ts b/test/page-route.spec.tsindex a6add82974..e55bdc47f0 100644--- a/test/page-route.spec.ts+++ b/test/page-route.spec.ts@@ -96,24 +96,20 @@ it('should work when header manipulation headers with redirect', async ({page, sawait page.goto(server.PREFIX + '/rrredirect');});// @see https://github.com/GoogleChrome/puppeteer/issues/4743-it('should be able to remove headers', (test, {browserName}) => {- // On WebKit the accept header gets set to "*/*"- test.fail(browserName === 'webkit');-}, async ({page, server}) => {+it('should be able to remove headers', async ({page, server}) => {+ await page.goto(server.EMPTY_PAGE);await page.route('**/*', route => {const headers = Object.assign({}, route.request().headers(), {- foo: 'bar',- accept: undefined, // remove "accept" header+ foo: undefined, // remove "foo" header});route.continue({ headers });});const [serverRequest] = await Promise.all([- server.waitForRequest('/empty.html'),- page.goto(server.PREFIX + '/empty.html')+ server.waitForRequest('/title.html'),+ page.evaluate(url => fetch(url, { headers: {foo: 'bar'} }), server.PREFIX + '/title.html')]);-- expect(serverRequest.headers.accept).toBe(undefined);+ expect(serverRequest.headers.foo).toBe(undefined);});it('should contain referer header', async ({page, server}) => {