diff options
author | Thomas <thomas.b.huang@gmail.com> | 2018-05-15 08:19:44 +0800 |
---|---|---|
committer | Thomas <thomas.b.huang@gmail.com> | 2018-05-15 08:19:44 +0800 |
commit | 517be35ab658e884fb00a241672527ed0669ead1 (patch) | |
tree | bc6ca38901f4f3ed4d929455ed71c023e4ebbf63 /test | |
parent | cd42d1820318739668774af25e9b1318cd2256dd (diff) | |
parent | 6e79225dbff512ab9bcae2731bcfc4ce33e98664 (diff) | |
download | tangerine-wallet-browser-517be35ab658e884fb00a241672527ed0669ead1.tar tangerine-wallet-browser-517be35ab658e884fb00a241672527ed0669ead1.tar.gz tangerine-wallet-browser-517be35ab658e884fb00a241672527ed0669ead1.tar.bz2 tangerine-wallet-browser-517be35ab658e884fb00a241672527ed0669ead1.tar.lz tangerine-wallet-browser-517be35ab658e884fb00a241672527ed0669ead1.tar.xz tangerine-wallet-browser-517be35ab658e884fb00a241672527ed0669ead1.tar.zst tangerine-wallet-browser-517be35ab658e884fb00a241672527ed0669ead1.zip |
Merge branch 'develop' into e2e-tests
Diffstat (limited to 'test')
-rw-r--r-- | test/integration/lib/mascara-first-time.js | 32 | ||||
-rw-r--r-- | test/integration/lib/tx-list-items.js | 4 | ||||
-rw-r--r-- | test/screens/new-ui.js | 4 |
3 files changed, 26 insertions, 14 deletions
diff --git a/test/integration/lib/mascara-first-time.js b/test/integration/lib/mascara-first-time.js index 5e07ab0b4..f43a30c74 100644 --- a/test/integration/lib/mascara-first-time.js +++ b/test/integration/lib/mascara-first-time.js @@ -1,5 +1,4 @@ const PASSWORD = 'password123' -const reactTriggerChange = require('react-trigger-change') const { timeout, findAsync, @@ -11,6 +10,11 @@ async function runFirstTimeUsageTest (assert, done) { const app = await queryAsync($, '#app-content') + // Used to set values on TextField input component + const nativeInputValueSetter = Object.getOwnPropertyDescriptor( + window.HTMLInputElement.prototype, 'value' + ).set + await skipNotices(app) const welcomeButton = (await findAsync(app, '.welcome-screen__button'))[0] @@ -21,12 +25,14 @@ async function runFirstTimeUsageTest (assert, done) { assert.equal(title, 'Create Password', 'create password screen') // enter password - const pwBox = (await findAsync(app, '.first-time-flow__input'))[0] - const confBox = (await findAsync(app, '.first-time-flow__input'))[1] - pwBox.value = PASSWORD - confBox.value = PASSWORD - reactTriggerChange(pwBox) - reactTriggerChange(confBox) + const pwBox = (await findAsync(app, '#create-password'))[0] + const confBox = (await findAsync(app, '#confirm-password'))[0] + + nativeInputValueSetter.call(pwBox, PASSWORD) + pwBox.dispatchEvent(new Event('input', { bubbles: true})) + + nativeInputValueSetter.call(confBox, PASSWORD) + confBox.dispatchEvent(new Event('input', { bubbles: true})) // Create Password const createButton = (await findAsync(app, 'button.first-time-flow__button'))[0] @@ -71,10 +77,16 @@ async function runFirstTimeUsageTest (assert, done) { assert.ok(lock, 'Lock menu item found') lock.click() - const pwBox2 = (await findAsync(app, '#password-box'))[0] - pwBox2.value = PASSWORD + await timeout(1000) + + const pwBox2 = (await findAsync(app, '#password'))[0] + pwBox2.focus() + await timeout(1000) + + nativeInputValueSetter.call(pwBox2, PASSWORD) + pwBox2.dispatchEvent(new Event('input', { bubbles: true})) - const createButton2 = (await findAsync(app, 'button.primary'))[0] + const createButton2 = (await findAsync(app, 'button[type="submit"]'))[0] createButton2.click() const detail2 = (await findAsync(app, '.wallet-view'))[0] diff --git a/test/integration/lib/tx-list-items.js b/test/integration/lib/tx-list-items.js index 0c0c5a77f..4856b3852 100644 --- a/test/integration/lib/tx-list-items.js +++ b/test/integration/lib/tx-list-items.js @@ -21,7 +21,7 @@ async function runTxListItemsTest(assert, done) { selectState.val('tx list items') reactTriggerChange(selectState[0]) - const metamaskLogo = await queryAsync($, '.left-menu-wrapper') + const metamaskLogo = await queryAsync($, '.app-header__logo-container') assert.ok(metamaskLogo[0], 'metamask logo present') metamaskLogo[0].click() @@ -46,7 +46,7 @@ async function runTxListItemsTest(assert, done) { const failedTx = txListItems[4] const failedTxRenderedStatus = await findAsync($(failedTx), '.tx-list-status') assert.equal(failedTxRenderedStatus[0].textContent, 'Failed', 'failedTx has correct label') - + const shapeShiftTx = txListItems[5] const shapeShiftTxStatus = await findAsync($(shapeShiftTx), '.flex-column div:eq(1)') assert.equal(shapeShiftTxStatus[0].textContent, 'No deposits received', 'shapeShiftTx has correct status') diff --git a/test/screens/new-ui.js b/test/screens/new-ui.js index e176da529..6a8822eb3 100644 --- a/test/screens/new-ui.js +++ b/test/screens/new-ui.js @@ -74,8 +74,8 @@ async function captureAllScreens() { await driver.findElement(By.css('button')).click() await captureLanguageScreenShots('create password') - const passwordBox = await driver.findElement(By.css('input[type=password]:nth-of-type(1)')) - const passwordBoxConfirm = await driver.findElement(By.css('input[type=password]:nth-of-type(2)')) + const passwordBox = await driver.findElement(By.css('input#create-password')) + const passwordBoxConfirm = await driver.findElement(By.css('input#confirm-password')) passwordBox.sendKeys('123456789') passwordBoxConfirm.sendKeys('123456789') await delay(500) |