From 85f6b4bd9b5d36db30b867e49448cde96df14f40 Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Wed, 20 Nov 2024 09:01:57 +0100 Subject: [PATCH] use existing filename --- packages/playwright/src/reporters/html.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/playwright/src/reporters/html.ts b/packages/playwright/src/reporters/html.ts index 1673f73eb4..406be15e83 100644 --- a/packages/playwright/src/reporters/html.ts +++ b/packages/playwright/src/reporters/html.ts @@ -133,7 +133,7 @@ class HtmlReporter implements ReporterV2 { const projectSuites = this.suite.suites; await removeFolders([this._outputFolder]); const builder = new HtmlBuilder(this.config, this._outputFolder, this._attachmentsBaseURL); - this._buildResult = await builder.build(this.config.metadata, this.config.rootDir, projectSuites, result, this._topLevelErrors); + this._buildResult = await builder.build(this.config.metadata, projectSuites, result, this._topLevelErrors); } async onExit() { @@ -238,13 +238,12 @@ class HtmlBuilder { this._attachmentsBaseURL = attachmentsBaseURL; } - async build(metadata: Metadata, rootDir: string, projectSuites: Suite[], result: FullResult, topLevelErrors: TestError[]): Promise<{ ok: boolean, singleTestId: string | undefined }> { + async build(metadata: Metadata, projectSuites: Suite[], result: FullResult, topLevelErrors: TestError[]): Promise<{ ok: boolean, singleTestId: string | undefined }> { const data = new Map(); for (const projectSuite of projectSuites) { for (const fileSuite of projectSuite.suites) { const fileName = this._relativeLocation(fileSuite.location)!.file; - const relativeFile = path.relative(rootDir, fileSuite.location!.file); - const fileId = calculateSha1(toPosixPath(relativeFile)).slice(0, 20); + const fileId = calculateSha1(toPosixPath(fileName)).slice(0, 20); let fileEntry = data.get(fileId); if (!fileEntry) { fileEntry = {