From d0b758a8d23ae258c24f1f83be1e155f504b4ea0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dar=C3=ADo=20Kondratiuk?= Date: Sun, 26 Jul 2020 03:58:03 -0300 Subject: [PATCH] test: improve autowaiting tests (#3168) --- test/autowaiting.jest.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/test/autowaiting.jest.js b/test/autowaiting.jest.js index 5b27c4d6ad..7294ed556e 100644 --- a/test/autowaiting.jest.js +++ b/test/autowaiting.jest.js @@ -107,12 +107,11 @@ describe('Auto waiting', () => { const messages = []; server.setRoute('/empty.html?cancel', async (req, res) => { res.end('done'); }); server.setRoute('/empty.html?override', async (req, res) => { messages.push('routeoverride'); res.end('done'); }); - await Promise.all([ - page.evaluate(` + await page.evaluate(` window.location.href = "${server.EMPTY_PAGE}?cancel"; window.location.href = "${server.EMPTY_PAGE}?override"; - `).then(() => messages.push('evaluate')), - ]); + `); + messages.push('evaluate'); expect(messages.join('|')).toBe('routeoverride|evaluate'); }); it('should await navigation when evaluating reload', async({page, server}) => { @@ -172,7 +171,6 @@ describe('Auto waiting', () => { }); it('should work with goto following click', async({page, server}) => { server.setRoute('/login.html', async (req, res) => { - messages.push('route'); res.setHeader('Content-Type', 'text/html'); res.end(`You are logged in`); });