fix(Page): fix page.goto to return Response when page pushes new state (#2468)

]Fixes #2411.
This commit is contained in:
Andrey Lushnikov
2018-04-28 00:15:40 -04:00
committed by GitHub
parent a2a9100248
commit 58c46680f3
4 changed files with 12 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
<script>
window.addEventListener('DOMContentLoaded', () => {
history.pushState({}, '', '#1');
});
</script>

View File

@@ -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;