Skip to content

Commit

Permalink
feat(e2e): Start attaching electron traces to the report
Browse files Browse the repository at this point in the history
  • Loading branch information
Vere-Grey committed Dec 11, 2024
1 parent c48c9fa commit a319202
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions packages/suite-desktop-core/e2e/support/fixtures.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable react-hooks/rules-of-hooks */
import { test as base, ElectronApplication, Page } from '@playwright/test';
import { existsSync } from 'node:fs';

import {
SetupEmu,
Expand Down Expand Up @@ -84,6 +85,23 @@ const test = base.extend<Fixtures>({
await use(window);
const tracePath = `${testInfo.outputDir}/trace.electron.zip`;
await window.context().tracing.stop({ path: tracePath });
testInfo.attachments.push({
name: 'trace',
path: tracePath,
contentType: 'application/zip',
});

// Attach video if it exists
const videoPath = `${testInfo.outputDir}/${testInfo.title}`;
console.error('videoPath', videoPath);
console.error('exists?', existsSync(videoPath));
if (existsSync(videoPath)) {
testInfo.attachments.push({
name: 'video',
path: videoPath,
contentType: 'video/webm',
});
}
} else {
await page.context().addInitScript(() => {
// Tells the app to attach Redux Store to window object. packages/suite-web/src/support/useCypress.ts
Expand Down

0 comments on commit a319202

Please sign in to comment.