Update index.ts for less generic screenshots

Signed-off-by: Marcin Strzyz <37447884+mastrzyz@users.noreply.github.com>
This commit is contained in:
Marcin Strzyz 2024-10-15 17:01:03 -07:00 committed by GitHub
parent c0c7f50a06
commit ff11f972dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;
}