From 388cdccb283e8d2b742f684a101cdc0a53f7ae00 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Thu, 30 Apr 2020 13:30:24 -0300 Subject: [PATCH] Capture UI state upon e2e test failure (#8481) The UI state is now captured and stored as a test artifact in the event of an e2e test failure. --- test/e2e/webdriver/driver.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/e2e/webdriver/driver.js b/test/e2e/webdriver/driver.js index 87a9c977f..5fb9ad58a 100644 --- a/test/e2e/webdriver/driver.js +++ b/test/e2e/webdriver/driver.js @@ -171,6 +171,8 @@ class Driver { await fs.writeFile(`${filepathBase}-screenshot.png`, screenshot, { encoding: 'base64' }) const htmlSource = await this.driver.getPageSource() await fs.writeFile(`${filepathBase}-dom.html`, htmlSource) + const uiState = await this.driver.executeScript(() => window.getCleanAppState()) + await fs.writeFile(`${filepathBase}-state.json`, JSON.stringify(uiState, null, 2)) } async checkBrowserForConsoleErrors () {