From ff11f972dc8c83ee63b3e2c16141af5fefbffde5 Mon Sep 17 00:00:00 2001 From: Marcin Strzyz <37447884+mastrzyz@users.noreply.github.com> Date: Tue, 15 Oct 2024 17:01:03 -0700 Subject: [PATCH] Update index.ts for less generic screenshots Signed-off-by: Marcin Strzyz <37447884+mastrzyz@users.noreply.github.com> --- packages/playwright/src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/playwright/src/index.ts b/packages/playwright/src/index.ts index add1661502..bc8cea9764 100644 --- a/packages/playwright/src/index.ts +++ b/packages/playwright/src/index.ts @@ -627,9 +627,10 @@ class ArtifactsRecorder { private _createScreenshotAttachmentPath() { const testFailed = this._testInfo._isFailure(); + const sanitizedTestName = this._testInfo._fsSanitizedTestName(); const index = this._screenshotOrdinal + 1; ++this._screenshotOrdinal; - const screenshotPath = this._testInfo.outputPath(`test-${testFailed ? 'failed' : 'finished'}-${index}.png`); + const screenshotPath = this._testInfo.outputPath(`test-${testFailed ? 'failed' : 'finished'}-${sanitizedTestName}-${index}.png`); return screenshotPath; }