diff --git a/packages/element-web-playwright-common/src/expect/screenshot.ts b/packages/element-web-playwright-common/src/expect/screenshot.ts index 37726fd958..6a4fadf0dc 100644 --- a/packages/element-web-playwright-common/src/expect/screenshot.ts +++ b/packages/element-web-playwright-common/src/expect/screenshot.ts @@ -70,8 +70,7 @@ export const expect = baseExpect.extend({ testInfo.annotations.push({ // `_` prefix hides it from the HTML reporter type: "_screenshot", - // include a path relative to `playwright/snapshots/` - description: testInfo.snapshotPath(screenshotName).split("/playwright/snapshots/", 2)[1], + description: testInfo.snapshotPath(screenshotName), }); return { pass: true, message: (): string => "", name: "toMatchScreenshot" }; diff --git a/packages/element-web-playwright-common/src/stale-screenshot-reporter.ts b/packages/element-web-playwright-common/src/stale-screenshot-reporter.ts index 7e2ab5b438..3814daa322 100644 --- a/packages/element-web-playwright-common/src/stale-screenshot-reporter.ts +++ b/packages/element-web-playwright-common/src/stale-screenshot-reporter.ts @@ -12,6 +12,7 @@ Please see LICENSE files in the repository root for full details. */ import { glob } from "glob"; +import path from "node:path"; import { type Reporter, type TestCase } from "@playwright/test/reporter"; import { type FullConfig } from "@playwright/test"; @@ -58,7 +59,7 @@ class StaleScreenshotReporter implements Reporter { for (const snapshotRoot of this.snapshotRoots) { const files = await glob(`**/*.png`, { cwd: snapshotRoot }); for (const file of files) { - screenshotFiles.add(file); + screenshotFiles.add(path.join(snapshotRoot, file)); } }