aboutsummaryrefslogtreecommitdiffstats
path: root/test/e2e/beta/metamask-beta-ui.spec.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-06-21 20:19:27 +0800
committerDan <danjm.com@gmail.com>2018-06-27 21:31:26 +0800
commitbdf9cd8e3ad0ba126f452f0ff2d7f52f25eb249e (patch)
treec20d03f07f36e58300f671c2dbeffea1ac47377e /test/e2e/beta/metamask-beta-ui.spec.js
parent07970b7cfa247541a21ceee0fbafce14ff77ff1d (diff)
downloadtangerine-wallet-browser-bdf9cd8e3ad0ba126f452f0ff2d7f52f25eb249e.tar
tangerine-wallet-browser-bdf9cd8e3ad0ba126f452f0ff2d7f52f25eb249e.tar.gz
tangerine-wallet-browser-bdf9cd8e3ad0ba126f452f0ff2d7f52f25eb249e.tar.bz2
tangerine-wallet-browser-bdf9cd8e3ad0ba126f452f0ff2d7f52f25eb249e.tar.lz
tangerine-wallet-browser-bdf9cd8e3ad0ba126f452f0ff2d7f52f25eb249e.tar.xz
tangerine-wallet-browser-bdf9cd8e3ad0ba126f452f0ff2d7f52f25eb249e.tar.zst
tangerine-wallet-browser-bdf9cd8e3ad0ba126f452f0ff2d7f52f25eb249e.zip
Speed up page opening and fix timeout errors on remix page opening in beta e2e tests.
Diffstat (limited to 'test/e2e/beta/metamask-beta-ui.spec.js')
-rw-r--r--test/e2e/beta/metamask-beta-ui.spec.js25
1 files changed, 12 insertions, 13 deletions
diff --git a/test/e2e/beta/metamask-beta-ui.spec.js b/test/e2e/beta/metamask-beta-ui.spec.js
index b0ed23691..6391e686e 100644
--- a/test/e2e/beta/metamask-beta-ui.spec.js
+++ b/test/e2e/beta/metamask-beta-ui.spec.js
@@ -17,6 +17,7 @@ const {
loadExtension,
verboseReportOnFailure,
testContract,
+ openNewPage,
} = require('./helpers')
describe('MetaMask', function () {
@@ -385,11 +386,13 @@ describe('MetaMask', function () {
describe('Send ETH from Faucet', () => {
it('starts a send transaction inside Faucet', async () => {
- await driver.executeScript('window.open("https://faucet.metamask.io")')
- await delay(waitingNewPageDelayMs)
+ await openNewPage(driver, 'https://faucet.metamask.io')
const [extension, faucet] = await driver.getAllWindowHandles()
await driver.switchTo().window(faucet)
+
+ const faucetPageTitle = await findElement(driver, By.css('.container-fluid'))
+ await driver.wait(until.elementTextMatches(faucetPageTitle, /MetaMask/))
await delay(regularDelayMs)
const send1eth = await findElement(driver, By.xpath(`//button[contains(text(), '10 ether')]`), 14000)
@@ -417,11 +420,10 @@ describe('MetaMask', function () {
describe('Deploy contract and call contract method from Remix', () => {
it('writes a contract to remix', async () => {
- await driver.executeScript('window.open("https://remix.ethereum.org/")')
- await delay(waitingNewPageDelayMs)
+ await openNewPage(driver, 'https://remix.ethereum.org/')
- const [extension, remix] = await driver.getAllWindowHandles()
- await driver.switchTo().window(remix)
+ const byFilePanel = By.css('#filepanel')
+ await driver.wait(until.elementLocated(byFilePanel))
const newContractButton = await findElement(driver, By.css('.fa-plus-circle'))
await newContractButton.click()
@@ -521,11 +523,9 @@ describe('MetaMask', function () {
describe('Add a custom token from TokenFactory', () => {
it('creates a new token', async () => {
- await driver.executeScript('window.open("https://tokenfactory.surge.sh/#/factory")')
- await delay(waitingNewPageDelayMs)
-
+ openNewPage(driver, 'https://tokenfactory.surge.sh/#/factory')
const [extension, tokenFactory] = await driver.getAllWindowHandles()
- await driver.switchTo().window(tokenFactory)
+
const [
totalSupply,
tokenName,
@@ -651,11 +651,10 @@ describe('MetaMask', function () {
describe('Send a custom token from TokenFactory', () => {
let gasModal
it('sends an already created token', async () => {
- await driver.executeScript(`window.open("https://tokenfactory.surge.sh/#/token/${tokenAddress}")`)
- await delay(waitingNewPageDelayMs)
+ openNewPage(driver, `https://tokenfactory.surge.sh/#/token/${tokenAddress}`)
const [extension, tokenFactory] = await driver.getAllWindowHandles()
- await driver.switchTo().window(tokenFactory)
+
const [
transferToAddress,
transferToAmount,