aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2017-09-12 11:14:52 +0800
committerkumavis <aaron@kumavis.me>2017-09-12 13:29:40 +0800
commit0e70366e9c31d3085d505f110b586418c72c217e (patch)
tree046be4adbf47aff4e6f81bd40752d9f41b4bb043 /test
parente9daf0eb280064a81235d144c71d41c8f1535aac (diff)
downloadtangerine-wallet-browser-0e70366e9c31d3085d505f110b586418c72c217e.tar.gz
tangerine-wallet-browser-0e70366e9c31d3085d505f110b586418c72c217e.tar.zst
tangerine-wallet-browser-0e70366e9c31d3085d505f110b586418c72c217e.zip
test - integration - drop testem for karma
Diffstat (limited to 'test')
-rw-r--r--test/integration/helpers.js7
-rw-r--r--test/integration/lib/first-time.js58
2 files changed, 43 insertions, 22 deletions
diff --git a/test/integration/helpers.js b/test/integration/helpers.js
deleted file mode 100644
index 10cd74e64..000000000
--- a/test/integration/helpers.js
+++ /dev/null
@@ -1,7 +0,0 @@
-function wait(time) {
- return new Promise(function (resolve, reject) {
- setTimeout(function () {
- resolve()
- }, time * 3 || 1500)
- })
-}
diff --git a/test/integration/lib/first-time.js b/test/integration/lib/first-time.js
index cc56b3704..c5ecfef95 100644
--- a/test/integration/lib/first-time.js
+++ b/test/integration/lib/first-time.js
@@ -10,26 +10,46 @@ QUnit.test('render init screen', (assert) => {
})
})
+<<<<<<< HEAD
+=======
+// QUnit.testDone(({ module, name, total, passed, failed, skipped, todo, runtime }) => {
+// if (failed > 0) {
+// const app = $('iframe').contents()[0].documentElement
+// console.warn('Test failures - dumping DOM:')
+// console.log(app.innerHTML)
+// }
+// })
+
+>>>>>>> 5c53bab... test - integration - drop testem for karma
async function runFirstTimeUsageTest(assert, done) {
- await wait()
- const app = $('iframe').contents().find('#app-content .mock-app-root')
+ await timeout()
+
+ const app = $('#app-content .mock-app-root')
const recurseNotices = async () => {
const button = app.find('button')
if (button.html() === 'Accept') {
const termsPage = app.find('.markdown')[0]
termsPage.scrollTop = termsPage.scrollHeight
- await wait()
+ await timeout()
button.click()
+<<<<<<< HEAD
await wait()
await recurseNotices()
+=======
+ await timeout()
+>>>>>>> 5c53bab... test - integration - drop testem for karma
} else {
await wait()
}
}
+<<<<<<< HEAD
await recurseNotices()
+=======
+ await timeout()
+>>>>>>> 5c53bab... test - integration - drop testem for karma
// Scroll through terms
const title = app.find('h1').text()
@@ -41,13 +61,13 @@ async function runFirstTimeUsageTest(assert, done) {
pwBox.value = PASSWORD
confBox.value = PASSWORD
- await wait()
+ await timeout()
// create vault
const createButton = app.find('button.primary')[0]
createButton.click()
- await wait(1500)
+ await timeout(1500)
const created = app.find('h3')[0]
assert.equal(created.textContent, 'Vault Created', 'Vault created screen')
@@ -57,7 +77,7 @@ async function runFirstTimeUsageTest(assert, done) {
assert.ok(button, 'button present')
button.click()
- await wait(1000)
+ await timeout(1000)
const detail = app.find('.account-detail-section')[0]
assert.ok(detail, 'Account detail section loaded.')
@@ -65,7 +85,7 @@ async function runFirstTimeUsageTest(assert, done) {
const sandwich = app.find('.sandwich-expando')[0]
sandwich.click()
- await wait()
+ await timeout()
const menu = app.find('.menu-droppo')[0]
const children = menu.children
@@ -73,7 +93,7 @@ async function runFirstTimeUsageTest(assert, done) {
assert.ok(lock, 'Lock menu item found')
lock.click()
- await wait(1000)
+ await timeout(1000)
const pwBox2 = app.find('#password-box')[0]
pwBox2.value = PASSWORD
@@ -81,39 +101,47 @@ async function runFirstTimeUsageTest(assert, done) {
const createButton2 = app.find('button.primary')[0]
createButton2.click()
- await wait(1000)
+ await timeout(1000)
const detail2 = app.find('.account-detail-section')[0]
assert.ok(detail2, 'Account detail section loaded again.')
- await wait()
+ await timeout()
// open account settings dropdown
const qrButton = app.find('.fa.fa-ellipsis-h')[0]
qrButton.click()
- await wait(1000)
+ await timeout(1000)
// qr code item
const qrButton2 = app.find('.dropdown-menu-item')[1]
qrButton2.click()
- await wait(1000)
+ await timeout(1000)
const qrHeader = app.find('.qr-header')[0]
const qrContainer = app.find('#qr-container')[0]
assert.equal(qrHeader.textContent, 'Account 1', 'Should show account label.')
assert.ok(qrContainer, 'QR Container found')
- await wait()
+ await timeout()
const networkMenu = app.find('.network-indicator')[0]
networkMenu.click()
- await wait()
+ await timeout()
const networkMenu2 = app.find('.network-indicator')[0]
const children2 = networkMenu2.children
children2.length[3]
assert.ok(children2, 'All network options present')
-} \ No newline at end of file
+}
+
+function timeout(time) {
+ return new Promise(function (resolve, reject) {
+ setTimeout(function () {
+ resolve()
+ }, time * 3 || 1500)
+ })
+}