diff options
author | Thomas Huang <tmashuang@users.noreply.github.com> | 2017-11-30 07:25:10 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-30 07:25:10 +0800 |
commit | c30b543a8069c3925bb254716699752e38eaf97a (patch) | |
tree | d9185abffcb5adfecdd99324b0e2e1e4f1e2b586 /test/integration/lib/mascara-first-time.js | |
parent | 23a5ea9321e4046338323e9df9e64d230d057df1 (diff) | |
parent | 91817573c95f2a1b234ab9fb7e39ac15ad44741d (diff) | |
download | tangerine-wallet-browser-c30b543a8069c3925bb254716699752e38eaf97a.tar tangerine-wallet-browser-c30b543a8069c3925bb254716699752e38eaf97a.tar.gz tangerine-wallet-browser-c30b543a8069c3925bb254716699752e38eaf97a.tar.bz2 tangerine-wallet-browser-c30b543a8069c3925bb254716699752e38eaf97a.tar.lz tangerine-wallet-browser-c30b543a8069c3925bb254716699752e38eaf97a.tar.xz tangerine-wallet-browser-c30b543a8069c3925bb254716699752e38eaf97a.tar.zst tangerine-wallet-browser-c30b543a8069c3925bb254716699752e38eaf97a.zip |
Merge pull request #2630 from MetaMask/i2624-VersionedNoticesv3.12.1
Versioned notices
Diffstat (limited to 'test/integration/lib/mascara-first-time.js')
-rw-r--r-- | test/integration/lib/mascara-first-time.js | 57 |
1 files changed, 23 insertions, 34 deletions
diff --git a/test/integration/lib/mascara-first-time.js b/test/integration/lib/mascara-first-time.js index 3398a5511..5c18cd254 100644 --- a/test/integration/lib/mascara-first-time.js +++ b/test/integration/lib/mascara-first-time.js @@ -6,23 +6,7 @@ async function runFirstTimeUsageTest (assert, done) { const app = $('#app-content') - // recurse notices - while (true) { - const button = app.find('button') - if (button.html() === 'Accept') { - // still notices to accept - const termsPage = app.find('.markdown')[0] - termsPage.scrollTop = termsPage.scrollHeight - await timeout() - console.log('Clearing notice') - button.click() - await timeout() - } else { - // exit loop - console.log('No more notices...') - break - } - } + await skipNotices(app) await timeout() @@ -51,28 +35,13 @@ async function runFirstTimeUsageTest (assert, done) { assert.equal(created.textContent, 'Your unique account image', 'unique image screen') // Agree button - const button = app.find('button')[0] + let button = app.find('button')[0] assert.ok(button, 'button present') button.click() await timeout(1000) - // 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) + await skipNotices(app) // secret backup phrase const seedTitle = app.find('.backup-phrase__title')[0] @@ -165,3 +134,23 @@ function timeout (time) { setTimeout(resolve, time || 1500) }) } + +async function skipNotices (app) { + while (true) { + const button = app.find('button') + if (button && button.html() === 'Accept') { + // still notices to accept + const termsPage = app.find('.markdown')[0] + if (!termsPage) { + break + } + termsPage.scrollTop = termsPage.scrollHeight + await timeout() + button.click() + await timeout() + } else { + console.log('No more notices...') + break + } + } +} |