fix(tests): do not throw if page did not produce video (#8112)
Fixes #8103
This commit is contained in:
parent
3bf3318350
commit
75981bc0aa
|
|
@ -151,7 +151,9 @@ export const playwrightFixtures: Fixtures<PlaywrightTestOptions & PlaywrightTest
|
|||
const videos = context.pages().map(p => 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' });
|
||||
|
|
|
|||
Loading…
Reference in a new issue