diff options
author | bitpshr <mail@bitpshr.net> | 2018-09-28 02:19:09 +0800 |
---|---|---|
committer | Dan Finlay <542863+danfinlay@users.noreply.github.com> | 2018-11-06 07:07:09 +0800 |
commit | c76c9ca2c86317f902f443db2c5704d4bf6311c0 (patch) | |
tree | e6b182dd8b0eb849d93143ecbd1217640aa8f490 /test/e2e/metamask.spec.js | |
parent | 2d4ff1dd82252cbe1abe06206fb2664f96905d91 (diff) | |
download | tangerine-wallet-browser-c76c9ca2c86317f902f443db2c5704d4bf6311c0.tar tangerine-wallet-browser-c76c9ca2c86317f902f443db2c5704d4bf6311c0.tar.gz tangerine-wallet-browser-c76c9ca2c86317f902f443db2c5704d4bf6311c0.tar.bz2 tangerine-wallet-browser-c76c9ca2c86317f902f443db2c5704d4bf6311c0.tar.lz tangerine-wallet-browser-c76c9ca2c86317f902f443db2c5704d4bf6311c0.tar.xz tangerine-wallet-browser-c76c9ca2c86317f902f443db2c5704d4bf6311c0.tar.zst tangerine-wallet-browser-c76c9ca2c86317f902f443db2c5704d4bf6311c0.zip |
EIP-1102: updated implementation
Diffstat (limited to 'test/e2e/metamask.spec.js')
-rw-r--r-- | test/e2e/metamask.spec.js | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/test/e2e/metamask.spec.js b/test/e2e/metamask.spec.js index 13af6cb22..4fee40af9 100644 --- a/test/e2e/metamask.spec.js +++ b/test/e2e/metamask.spec.js @@ -2,6 +2,11 @@ const path = require('path') const assert = require('assert') const { By, Key, until } = require('selenium-webdriver') const { delay, createModifiedTestBuild, setupBrowserAndExtension, verboseReportOnFailure } = require('./func') +const { + closeAllWindowHandlesExcept, + switchToWindowWithTitle, + switchToWindowWithUrlThatMatches, +} = require('./beta/helpers') describe('Metamask popup page', function () { const browser = process.env.SELENIUM_BROWSER @@ -183,6 +188,7 @@ describe('Metamask popup page', function () { }) it('restores from seed phrase', async function () { + await delay(1000) const restoreSeedLink = await driver.findElement(By.css('#app-content > div > div.app-primary.from-left > div > div.flex-row.flex-center.flex-grow > p')) assert.equal(await restoreSeedLink.getText(), 'Restore from seed phrase') await restoreSeedLink.click() @@ -201,10 +207,10 @@ describe('Metamask popup page', function () { }) it('balance renders', async function () { - await delay(500) + await delay(1000) const balance = await driver.findElement(By.css('#app-content > div > div.app-primary.from-right > div > div > div.flex-row > div.ether-balance.ether-balance-amount > div > div > div:nth-child(1) > div:nth-child(1)')) assert.equal(await balance.getText(), '100.000') - await delay(200) + await delay(1000) }) it('sends transaction', async function () { @@ -242,12 +248,31 @@ describe('Metamask popup page', function () { }) describe('Token Factory', function () { + let windowHandles + let extension + let dapp it('navigates to token factory', async function () { - await driver.get('http://tokenfactory.surge.sh/') + await driver.get('http://token-factory-1102.now.sh') + await delay(7000) + windowHandles = await driver.getAllWindowHandles() + + dapp = await switchToWindowWithTitle(driver, 'Token Factory', windowHandles) + await delay(400) + extension = await switchToWindowWithUrlThatMatches(driver, /notification.html/, windowHandles) + await delay(400) + + await closeAllWindowHandlesExcept(driver, [extension, dapp]) + await switchToWindowWithUrlThatMatches(driver, /notification.html/, [extension, dapp]) + const approveButton = await driver.wait(until.elementLocated(By.xpath(`//button[contains(text(), 'APPROVE')]`)), 10000) + await approveButton.click() }) it('navigates to create token contract link', async function () { + await delay(400) + await switchToWindowWithTitle(driver, 'Token Factory', windowHandles) + await delay(400) + const createToken = await driver.findElement(By.css('#bs-example-navbar-collapse-1 > ul > li:nth-child(3) > a')) await createToken.click() }) |