revert _attachScreenshot change

This commit is contained in:
Simon Knott 2024-12-20 13:23:57 +01:00
parent 5ea54226ed
commit 9d6abe5b60
No known key found for this signature in database
GPG key ID: 8CEDC00028084AEC

View file

@ -638,7 +638,7 @@ class ArtifactsRecorder {
try {
const screenshotPath = this._createScreenshotAttachmentPath();
await fs.promises.rename(file, screenshotPath);
await this._attachScreenshot(screenshotPath);
this._attachScreenshot(screenshotPath);
} catch {
}
}
@ -665,14 +665,14 @@ class ArtifactsRecorder {
if (temporary)
this._temporaryScreenshots.push(screenshotPath);
else
await this._attachScreenshot(screenshotPath);
this._attachScreenshot(screenshotPath);
} catch {
// Screenshot may fail, just ignore.
}
}
private async _attachScreenshot(screenshotPath: string) {
await this._testInfo.attach('screenshot', { path: screenshotPath, contentType: 'image/png' });
private _attachScreenshot(screenshotPath: string) {
this._testInfo.attachments.push({ name: 'screenshot', path: screenshotPath, contentType: 'image/png' });
}
private async _screenshotOnTestFailure() {