From 75981bc0aa27bf4f05079c0b6108681ead7f78a2 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Tue, 10 Aug 2021 01:24:14 -0700 Subject: [PATCH] fix(tests): do not throw if page did not produce video (#8112) Fixes #8103 --- tests/config/browserTest.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/config/browserTest.ts b/tests/config/browserTest.ts index a446712b95..b9eacd376c 100644 --- a/tests/config/browserTest.ts +++ b/tests/config/browserTest.ts @@ -151,7 +151,9 @@ export const playwrightFixtures: Fixtures p.video()).filter(Boolean); await context.close(); for (const v of videos) { - const videoPath = await v.path(); + const videoPath = await v.path().catch(() => null); + if (!videoPath) + continue; const savedPath = testInfo.outputPath(path.basename(videoPath)); await v.saveAs(savedPath); testInfo.attachments.push({ name: 'video', path: savedPath, contentType: 'video/webm' });