1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 01:47:00 +01:00

Expand error details before taking screenshot (#15779)

This commit is contained in:
seaona 2022-09-09 14:40:51 +02:00 committed by GitHub
parent 216f76646e
commit 9cf401bb92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -382,6 +382,10 @@ class Driver {
const artifactDir = `./test-artifacts/${this.browser}/${title}`;
const filepathBase = `${artifactDir}/test-failure`;
await fs.mkdir(artifactDir, { recursive: true });
const isPageError = await this.isElementPresent('.error-page__details');
if (isPageError) {
await this.clickElement('.error-page__details');
}
const screenshot = await this.driver.takeScreenshot();
await fs.writeFile(`${filepathBase}-screenshot.png`, screenshot, {
encoding: 'base64',