From 9cf401bb92093d077622a81f8dc5beb5c0d0e4db Mon Sep 17 00:00:00 2001 From: seaona <54408225+seaona@users.noreply.github.com> Date: Fri, 9 Sep 2022 14:40:51 +0200 Subject: [PATCH] Expand error details before taking screenshot (#15779) --- test/e2e/webdriver/driver.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/e2e/webdriver/driver.js b/test/e2e/webdriver/driver.js index d7bd58818..59416becb 100644 --- a/test/e2e/webdriver/driver.js +++ b/test/e2e/webdriver/driver.js @@ -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',