aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorChi Kei Chan <chikeichan@gmail.com>2017-10-04 05:43:11 +0800
committerChi Kei Chan <chikeichan@gmail.com>2017-10-21 12:51:37 +0800
commit5484e688961624b41fe8850d578ff47e023fa8a1 (patch)
tree6fccabc34e7c3a2a437053a6096a146f272e2d27 /test
parentd9735ed5b31caf17506e6cace436f6268f5ca78d (diff)
downloadtangerine-wallet-browser-5484e688961624b41fe8850d578ff47e023fa8a1.tar
tangerine-wallet-browser-5484e688961624b41fe8850d578ff47e023fa8a1.tar.gz
tangerine-wallet-browser-5484e688961624b41fe8850d578ff47e023fa8a1.tar.bz2
tangerine-wallet-browser-5484e688961624b41fe8850d578ff47e023fa8a1.tar.lz
tangerine-wallet-browser-5484e688961624b41fe8850d578ff47e023fa8a1.tar.xz
tangerine-wallet-browser-5484e688961624b41fe8850d578ff47e023fa8a1.tar.zst
tangerine-wallet-browser-5484e688961624b41fe8850d578ff47e023fa8a1.zip
Add Integration Tests
Diffstat (limited to 'test')
-rw-r--r--test/integration/lib/mascara-first-time.js59
1 files changed, 50 insertions, 9 deletions
diff --git a/test/integration/lib/mascara-first-time.js b/test/integration/lib/mascara-first-time.js
index 7dff33657..3398a5511 100644
--- a/test/integration/lib/mascara-first-time.js
+++ b/test/integration/lib/mascara-first-time.js
@@ -1,6 +1,5 @@
const PASSWORD = 'password123'
-
-window.testUtils = require('react-dom/test-utils')
+const reactTriggerChange = require('react-trigger-change')
async function runFirstTimeUsageTest (assert, done) {
await timeout(4000)
@@ -36,20 +35,20 @@ async function runFirstTimeUsageTest (assert, done) {
const confBox = app.find('.first-time-flow__input')[1]
pwBox.value = PASSWORD
confBox.value = PASSWORD
- $(pwBox).change()
- $(confBox).change()
+ reactTriggerChange(pwBox)
+ reactTriggerChange(confBox)
await timeout()
- // create vault
+ // Create Password
const createButton = app.find('button.first-time-flow__button')[0]
createButton.click()
await timeout(3000)
- const created = app.find('h3')[0]
- assert.equal(created.textContent, 'Vault Created', 'Vault created screen')
+ const created = app.find('.unique-image__title')[0]
+ assert.equal(created.textContent, 'Your unique account image', 'unique image screen')
// Agree button
const button = app.find('button')[0]
@@ -58,8 +57,50 @@ async function runFirstTimeUsageTest (assert, done) {
await timeout(1000)
- const detail = app.find('.account-detail-section')[0]
- assert.ok(detail, 'Account detail section loaded.')
+ // Privacy Screen
+ const detail = app.find('.tou__title')[0]
+ assert.equal(detail.textContent, 'Privacy Notice', 'privacy notice screen')
+ app.find('button').click()
+
+ await timeout(1000)
+
+
+ // terms of service screen
+ const tou = app.find('.tou__title')[0]
+ assert.equal(tou.textContent, 'Terms of Use', 'terms of use screen')
+ app.find('.tou__body').scrollTop(100000)
+ await timeout(1000)
+
+ app.find('.first-time-flow__button').click()
+ await timeout(1000)
+
+ // secret backup phrase
+ const seedTitle = app.find('.backup-phrase__title')[0]
+ assert.equal(seedTitle.textContent, 'Secret Backup Phrase', 'seed phrase screen')
+ app.find('.backup-phrase__reveal-button').click()
+
+ await timeout(1000)
+ const seedPhrase = app.find('.backup-phrase__secret-words').text().split(' ')
+ app.find('.first-time-flow__button').click()
+
+ const selectPhrase = text => {
+ const option = $('.backup-phrase__confirm-seed-option')
+ .filter((i, d) => d.textContent === text)[0]
+
+ $(option).click()
+ }
+
+ await timeout(1000)
+
+ seedPhrase.forEach(sp => selectPhrase(sp))
+ app.find('.first-time-flow__button').click()
+ await timeout(1000)
+
+ // Deposit Ether Screen
+ const buyEthTitle = app.find('.buy-ether__title')[0]
+ assert.equal(buyEthTitle.textContent, 'Deposit Ether', 'deposit ether screen')
+ app.find('.buy-ether__do-it-later').click()
+ await timeout(1000)
const sandwich = app.find('.sandwich-expando')[0]
sandwich.click()