Skip to content

Commit

Permalink
fix: improve flaky example test
Browse files Browse the repository at this point in the history
  • Loading branch information
barjin committed Dec 18, 2024
1 parent 9cbd79b commit 15bc339
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion templates/ts-playwright-test-runner/tests/first.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ test('has appropriate size', async ({ page }) => {
let totalDownloaded = 0;

await page.on('response', async (r) => {
totalDownloaded += await (await r.body()).byteLength;
r.body().then((b) => {
totalDownloaded += b.byteLength;
}).catch(() => {
// Ignore errors.
});
});

await page.goto('https://apify.com/about', { waitUntil: 'networkidle' });
Expand Down

0 comments on commit 15bc339

Please sign in to comment.