1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00

Check if getCleanAppState is defined before calling (#9170)

This commit is contained in:
Erik Marks 2020-08-10 08:58:17 -07:00 committed by GitHub
parent cb503d9403
commit 4922b1b9b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -180,7 +180,9 @@ 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())
const uiState = await this.driver.executeScript(
() => window.getCleanAppState && window.getCleanAppState(),
)
await fs.writeFile(`${filepathBase}-state.json`, JSON.stringify(uiState, null, 2))
}