test: fix flaky interception test (#1508)

This commit is contained in:
Dmitry Gozman 2020-03-24 09:08:29 -07:00 committed by GitHub
parent b778789ba8
commit 4f89e4031c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -254,11 +254,9 @@ module.exports.describe = function({testRunner, expect, defaultBrowserOptions, p
spinner ? route.abort() : route.continue();
spinner = !spinner;
});
const results = await page.evaluate(() => Promise.all([
fetch('/zzz').then(response => response.text()).catch(e => 'FAILED'),
fetch('/zzz').then(response => response.text()).catch(e => 'FAILED'),
fetch('/zzz').then(response => response.text()).catch(e => 'FAILED'),
]));
const results = [];
for (let i = 0; i < 3; i++)
results.push(await page.evaluate(() => fetch('/zzz').then(response => response.text()).catch(e => 'FAILED')));
expect(results).toEqual(['11', 'FAILED', '22']);
});
it('should navigate to dataURL and not fire dataURL requests', async({page, server}) => {