aboutsummaryrefslogtreecommitdiffstats
path: root/test/e2e
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-06-19 08:22:52 +0800
committerDan <danjm.com@gmail.com>2018-06-27 21:31:26 +0800
commit309239afb402e7729184ff7c5956497263b4e0b8 (patch)
treef929063bd93849d2bfc6a8e4ef5eb62d3afd74c6 /test/e2e
parent13e0b42359bcc51e8ed4f342a5e3d3edb4cb4c3e (diff)
downloadtangerine-wallet-browser-309239afb402e7729184ff7c5956497263b4e0b8.tar
tangerine-wallet-browser-309239afb402e7729184ff7c5956497263b4e0b8.tar.gz
tangerine-wallet-browser-309239afb402e7729184ff7c5956497263b4e0b8.tar.bz2
tangerine-wallet-browser-309239afb402e7729184ff7c5956497263b4e0b8.tar.lz
tangerine-wallet-browser-309239afb402e7729184ff7c5956497263b4e0b8.tar.xz
tangerine-wallet-browser-309239afb402e7729184ff7c5956497263b4e0b8.tar.zst
tangerine-wallet-browser-309239afb402e7729184ff7c5956497263b4e0b8.zip
Wait for locating of submit buttons before attempting to click in metamask.spec.js
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/metamask.spec.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/e2e/metamask.spec.js b/test/e2e/metamask.spec.js
index b0a8fe411..6ab21dfcd 100644
--- a/test/e2e/metamask.spec.js
+++ b/test/e2e/metamask.spec.js
@@ -4,7 +4,7 @@ const path = require('path')
const assert = require('assert')
const pify = require('pify')
const webdriver = require('selenium-webdriver')
-const { By, Key } = webdriver
+const { By, Key, until } = webdriver
const { delay, buildChromeWebDriver, buildFirefoxWebdriver, installWebExt, getExtensionIdChrome, getExtensionIdFirefox } = require('./func')
describe('Metamask popup page', function () {
@@ -229,7 +229,11 @@ describe('Metamask popup page', function () {
it('confirms transaction', async function () {
await delay(300)
- await driver.findElement(By.css('#pending-tx-form > div.flex-row.flex-space-around.conf-buttons > input')).click()
+ const bySubmitButton = By.css('#pending-tx-form > div.flex-row.flex-space-around.conf-buttons > input')
+ const submitButton = await driver.wait(until.elementLocated(bySubmitButton))
+
+ submitButton.click()
+
await delay(500)
})
@@ -269,7 +273,8 @@ describe('Metamask popup page', function () {
it('confirms transaction in MetaMask popup', async function () {
const windowHandles = await driver.getAllWindowHandles()
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'))
+ const byMetamaskSubmit = By.css('#pending-tx-form > div.flex-row.flex-space-around.conf-buttons > input')
+ const metamaskSubmit = await driver.wait(until.elementLocated(byMetamaskSubmit))
await metamaskSubmit.click()
await delay(1000)
})