From 6afd169e603fead364aa3608c90e6e8a20fcb0dc Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Mon, 14 May 2018 13:57:19 -0230 Subject: [PATCH] e2e: Use newest window as MM tx confirm popup --- test/e2e/chrome/metamask.spec.js | 2 +- test/e2e/firefox/metamask.spec.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/chrome/metamask.spec.js b/test/e2e/chrome/metamask.spec.js index d72ebe1a9..87ccf8a83 100644 --- a/test/e2e/chrome/metamask.spec.js +++ b/test/e2e/chrome/metamask.spec.js @@ -237,7 +237,7 @@ describe('Metamask popup page', function () { it('confirms transaction in MetaMask popup', async function () { const windowHandles = await driver.getAllWindowHandles() - await driver.switchTo().window(windowHandles[2]) + await driver.switchTo().window(windowHandles[windowHandles.length - 1]) const metamaskSubmit = await driver.findElement(By.css('#pending-tx-form > div.flex-row.flex-space-around.conf-buttons > input')) await metamaskSubmit.click() await delay(1000) diff --git a/test/e2e/firefox/metamask.spec.js b/test/e2e/firefox/metamask.spec.js index 20b8a5092..26e5dfb40 100644 --- a/test/e2e/firefox/metamask.spec.js +++ b/test/e2e/firefox/metamask.spec.js @@ -238,7 +238,7 @@ describe('', function () { // There is an issue with blank confirmation window, but the button is still there and the driver is able to clicked (?.?) it('confirms transaction in MetaMask popup', async function () { const windowHandles = await driver.getAllWindowHandles() - await driver.switchTo().window(windowHandles[2]) + await driver.switchTo().window(windowHandles[windowHandles.length - 1]) const metamaskSubmit = await driver.findElement(By.css('#pending-tx-form > div.flex-row.flex-space-around.conf-buttons > input')) await metamaskSubmit.click() await delay(1000)