aboutsummaryrefslogtreecommitdiffstats
path: root/test/e2e/metamask.spec.js
diff options
context:
space:
mode:
authorbrunobar79 <brunobar79@gmail.com>2018-07-02 05:41:34 +0800
committerbrunobar79 <brunobar79@gmail.com>2018-07-02 05:41:34 +0800
commit1494cc5e6c5943095c89e3b243b0a6152876e72c (patch)
treee34e74e79e8d41ce5903cc8d6eedf5caa19bc354 /test/e2e/metamask.spec.js
parent6e563acd93cbaf20fb233a267104fc6af3384287 (diff)
parentb2e64f24ecbc9e309869e678254cf755ffe11b40 (diff)
downloadtangerine-wallet-browser-1494cc5e6c5943095c89e3b243b0a6152876e72c.tar.gz
tangerine-wallet-browser-1494cc5e6c5943095c89e3b243b0a6152876e72c.tar.zst
tangerine-wallet-browser-1494cc5e6c5943095c89e3b243b0a6152876e72c.zip
fix merge conflicts
Diffstat (limited to 'test/e2e/metamask.spec.js')
-rw-r--r--test/e2e/metamask.spec.js36
1 files changed, 26 insertions, 10 deletions
diff --git a/test/e2e/metamask.spec.js b/test/e2e/metamask.spec.js
index a08a34d96..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 () {
@@ -71,13 +71,6 @@ describe('Metamask popup page', function () {
it('matches MetaMask title', async () => {
const title = await driver.getTitle()
assert.equal(title, 'MetaMask', 'title matches MetaMask')
- })
-
- it('shows privacy notice', async () => {
- await delay(300)
- const privacy = await driver.findElement(By.css('.terms-header')).getText()
- assert.equal(privacy, 'PRIVACY NOTICE', 'shows privacy notice')
- await driver.findElement(By.css('button')).click()
await delay(300)
})
@@ -100,6 +93,24 @@ describe('Metamask popup page', function () {
await button.click()
})
+ it('shows privacy notice', async () => {
+ const privacy = await driver.findElement(By.css('.terms-header')).getText()
+ assert.equal(privacy, 'PRIVACY NOTICE', 'shows privacy notice')
+ await driver.findElement(By.css('button')).click()
+ await delay(300)
+ })
+
+ it('shows phishing notice', async () => {
+ await delay(300)
+ const noticeHeader = await driver.findElement(By.css('.terms-header')).getText()
+ assert.equal(noticeHeader, 'PHISHING WARNING', 'shows phishing warning')
+ const element = await driver.findElement(By.css('.markdown'))
+ await driver.executeScript('arguments[0].scrollTop = arguments[0].scrollHeight', element)
+ await delay(300)
+ await driver.findElement(By.css('button')).click()
+ await delay(300)
+ })
+
it('accepts password with length of eight', async () => {
const passwordBox = await driver.findElement(By.id('password-box'))
const passwordBoxConfirm = await driver.findElement(By.id('password-box-confirm'))
@@ -218,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)
})
@@ -258,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)
})