From bf9d1f405fa3a2c5859291340b6f3ecdce47cac4 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Mon, 20 Feb 2017 13:41:46 -0800 Subject: add waits between notices. --- test/integration/lib/first-time.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test') diff --git a/test/integration/lib/first-time.js b/test/integration/lib/first-time.js index 55a16ef38..79fbb8f58 100644 --- a/test/integration/lib/first-time.js +++ b/test/integration/lib/first-time.js @@ -9,6 +9,19 @@ QUnit.test('render init screen', function (assert) { wait().then(function() { app = $('iframe').contents().find('#app-content .mock-app-root') + const recurseNotices = function () { + var button = app.find('button') + if (button.html() === 'Continue') { + button.click() + return wait().then(() => { + return recurseNotices() + }) + } else { + return wait() + } + } + return recurseNotices() + }).then(function() { // Scroll through terms var title = app.find('h1').text() assert.equal(title, 'MetaMask', 'title screen') -- cgit From 736637363b910560b4937a40bdde773cd5843f93 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Mon, 20 Feb 2017 15:07:01 -0800 Subject: Integration tests play nice with new disabled buttons. --- test/integration/lib/first-time.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/integration/lib/first-time.js b/test/integration/lib/first-time.js index 79fbb8f58..dbb88a3da 100644 --- a/test/integration/lib/first-time.js +++ b/test/integration/lib/first-time.js @@ -10,10 +10,14 @@ QUnit.test('render init screen', function (assert) { app = $('iframe').contents().find('#app-content .mock-app-root') const recurseNotices = function () { - var button = app.find('button') + let button = app.find('button') if (button.html() === 'Continue') { - button.click() + let termsPage = app.find('.markdown')[0] + termsPage.scrollTop = termsPage.scrollHeight return wait().then(() => { + button.click() + return wait() + }).then(() => { return recurseNotices() }) } else { -- cgit From 2baedc56eafcc0e26fdaab1706953dc2d949570d Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Mon, 20 Feb 2017 23:42:40 -0800 Subject: Add log global to test suite --- test/helper.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test') diff --git a/test/helper.js b/test/helper.js index 64fe5bd07..a01ea1e53 100644 --- a/test/helper.js +++ b/test/helper.js @@ -1,5 +1,11 @@ +var log = require('loglevel') +log.setDefaultLevel(5) + require('jsdom-global')() window.localStorage = {} if (!('crypto' in window)) { window.crypto = {} } window.crypto.getRandomValues = require('polyfill-crypto.getrandomvalues') + +window.log = log +global.log = log -- cgit