mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
fix(Page): fix page.goto to return Response when page pushes new state (#2468)
]Fixes #2411.
This commit is contained in:
5
test/assets/historyapi.html
Normal file
5
test/assets/historyapi.html
Normal file
@@ -0,0 +1,5 @@
|
||||
<script>
|
||||
window.addEventListener('DOMContentLoaded', () => {
|
||||
history.pushState({}, '', '#1');
|
||||
});
|
||||
</script>
|
||||
@@ -383,6 +383,10 @@ module.exports.addTests = function({testRunner, expect, puppeteer, DeviceDescrip
|
||||
const response = await page.goto('about:blank');
|
||||
expect(response).toBe(null);
|
||||
});
|
||||
it('should return response when page changes its URL after load', async({page, server}) => {
|
||||
const response = await page.goto(server.PREFIX + '/historyapi.html');
|
||||
expect(response.status()).toBe(200);
|
||||
});
|
||||
it('should work with subframes return 204', async({page, server}) => {
|
||||
server.setRoute('/frames/frame.html', (req, res) => {
|
||||
res.statusCode = 204;
|
||||
|
||||
Reference in New Issue
Block a user