mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
test: add test for request interception with 302 after POST (#3105)
References #3089
This commit is contained in:
parent
d6eb3b4d52
commit
ce64ae22f4
@ -251,6 +251,21 @@ module.exports.addTests = function({testRunner, expect}) {
|
|||||||
const response = await page.goto(server.EMPTY_PAGE);
|
const response = await page.goto(server.EMPTY_PAGE);
|
||||||
expect(response.ok()).toBe(true);
|
expect(response.ok()).toBe(true);
|
||||||
});
|
});
|
||||||
|
xit('should work when POST is redirected with 302', async({page, server}) => {
|
||||||
|
server.setRedirect('/rredirect', '/empty.html');
|
||||||
|
await page.goto(server.EMPTY_PAGE);
|
||||||
|
await page.setRequestInterception(true);
|
||||||
|
page.on('request', request => request.continue());
|
||||||
|
await page.setContent(`
|
||||||
|
<form action='/rredirect' method='post'>
|
||||||
|
<input type="hidden" id="foo" name="foo" value="FOOBAR">
|
||||||
|
</form>
|
||||||
|
`);
|
||||||
|
await Promise.all([
|
||||||
|
page.$eval('form', form => form.submit()),
|
||||||
|
page.waitForNavigation()
|
||||||
|
]);
|
||||||
|
});
|
||||||
it('should contain referer header', async({page, server}) => {
|
it('should contain referer header', async({page, server}) => {
|
||||||
await page.setRequestInterception(true);
|
await page.setRequestInterception(true);
|
||||||
const requests = [];
|
const requests = [];
|
||||||
|
Loading…
Reference in New Issue
Block a user