From ea4f42b7ed51faeb38ec13f1a836b0d364ec67cd Mon Sep 17 00:00:00 2001 From: Dmitry Gozman Date: Tue, 3 Aug 2021 17:07:57 -0700 Subject: [PATCH] feat(report): add video to attachments (#7976) --- src/test/index.ts | 5 +++-- tests/playwright-test/playwright.spec.ts | 10 +++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/test/index.ts b/src/test/index.ts index e963939224..075a70f5cd 100644 --- a/src/test/index.ts +++ b/src/test/index.ts @@ -251,8 +251,9 @@ export const test = _baseTest.extend file.endsWith('webm')); + const dirRetry = testInfo.outputPath('test-results', 'a-fail-chromium-retry1'); + const videoFailRetry = fs.readdirSync(dirRetry).find(file => file.endsWith('webm')); expect(videoFailRetry).toBeTruthy(); + + expect(result.report.suites[0].specs[1].tests[0].results[0].attachments).toEqual([]); + expect(result.report.suites[0].specs[1].tests[0].results[1].attachments).toEqual([{ + name: 'video', + contentType: 'video/webm', + path: path.join(dirRetry, videoFailRetry), + }]); }); test('should work with video size', async ({ runInlineTest }, testInfo) => {