Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

test: improve autowaiting tests (#3168)

Darío Kondratiukd0b758a8d23a
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`);
});