From 770411be9d9c0cfdbe3685bec4efa3ba741482c8 Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Fri, 19 Apr 2019 18:22:30 -0700 Subject: [PATCH] test: verify overriding postdata and method on navigation (#4317) References #4309 --- test/requestinterception.spec.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/requestinterception.spec.js b/test/requestinterception.spec.js index 04ac8244f17..0531a464ff5 100644 --- a/test/requestinterception.spec.js +++ b/test/requestinterception.spec.js @@ -424,6 +424,18 @@ module.exports.addTests = function({testRunner, expect, CHROME}) { ]); expect(await serverRequest.postBody).toBe('doggo'); }); + it_fails_ffox('should amend both post data and method on navigation', async({page, server}) => { + await page.setRequestInterception(true); + page.on('request', request => { + request.continue({ method: 'POST', postData: 'doggo' }); + }); + const [serverRequest] = await Promise.all([ + server.waitForRequest('/empty.html'), + page.goto(server.EMPTY_PAGE), + ]); + expect(serverRequest.method).toBe('POST'); + expect(await serverRequest.postBody).toBe('doggo'); + }); }); describe_fails_ffox('Request.respond', function() {