aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-11-30 04:30:10 +0800
committerDan Finlay <dan@danfinlay.com>2017-11-30 04:30:10 +0800
commit9276fea6bc3a2d3678afdd60fa14e661b64a30a0 (patch)
tree3782b85de8650f14ac433809a780d2690a743c7a
parent119c0fdecf504fcaa84987639e8f3c031b1b8285 (diff)
downloadtangerine-wallet-browser-9276fea6bc3a2d3678afdd60fa14e661b64a30a0.tar.gz
tangerine-wallet-browser-9276fea6bc3a2d3678afdd60fa14e661b64a30a0.tar.zst
tangerine-wallet-browser-9276fea6bc3a2d3678afdd60fa14e661b64a30a0.zip
Redundantly skip notices
-rw-r--r--test/integration/lib/mascara-first-time.js47
1 files changed, 22 insertions, 25 deletions
diff --git a/test/integration/lib/mascara-first-time.js b/test/integration/lib/mascara-first-time.js
index aebaef83c..6772dd701 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 && 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
- }
- }
+ skipNotices()
await timeout()
@@ -57,14 +41,7 @@ async function runFirstTimeUsageTest (assert, done) {
await timeout(1000)
- // Skip notices:
- let detail = app.find('.tou__title')[0]
- button = app.find('button')[0]
- if (button && button.html() === 'Accept') {
- app.find('button').click()
- await timeout(1000)
- button = app.find('button')
- }
+ skipNotices()
// secret backup phrase
const seedTitle = app.find('.backup-phrase__title')[0]
@@ -157,3 +134,23 @@ function timeout (time) {
setTimeout(resolve, time || 1500)
})
}
+
+function skipNotices () {
+ while (true) {
+ const button = app.find('button')
+ if (button && 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 {
+ console.dir(button)
+ // exit loop
+ console.log('No more notices...')
+ break
+ }
+ }
+}