mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Wait for locating of submit buttons before attempting to click in metamask.spec.js
This commit is contained in:
parent
13e0b42359
commit
309239afb4
@ -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)
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user