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

Fix crash on e2e test failure (#16556)

If an e2e test fails on a website, the driver will crash on this line
because it can't find a reference to `stateHooks`. That variable is
only set in our UI, not on other sites.
This commit is contained in:
Mark Stacey 2022-11-17 11:29:06 -03:30 committed by GitHub
parent 3746ad9451
commit 0841c1df4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -416,7 +416,7 @@ class Driver {
await fs.writeFile(`${filepathBase}-dom.html`, htmlSource);
const uiState = await this.driver.executeScript(
() =>
window.stateHooks.getCleanAppState &&
window.stateHooks?.getCleanAppState &&
window.stateHooks.getCleanAppState(),
);
await fs.writeFile(