diff options
author | Dan J Miller <danjm.com@gmail.com> | 2019-01-26 02:09:18 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-26 02:09:18 +0800 |
commit | ab9c20db5b76fef2bc1add5a2ed31c2fb8ac78b2 (patch) | |
tree | c3becd6287f0742fa61d621d8ff06ab9ae0c3926 /test | |
parent | 456bfaf9ed87fc84598d3f81f451e08e30ff5de0 (diff) | |
parent | bf4b6770a0d9ae2dfb05da9c761a45bd3700b7a1 (diff) | |
download | tangerine-wallet-browser-ab9c20db5b76fef2bc1add5a2ed31c2fb8ac78b2.tar tangerine-wallet-browser-ab9c20db5b76fef2bc1add5a2ed31c2fb8ac78b2.tar.gz tangerine-wallet-browser-ab9c20db5b76fef2bc1add5a2ed31c2fb8ac78b2.tar.bz2 tangerine-wallet-browser-ab9c20db5b76fef2bc1add5a2ed31c2fb8ac78b2.tar.lz tangerine-wallet-browser-ab9c20db5b76fef2bc1add5a2ed31c2fb8ac78b2.tar.xz tangerine-wallet-browser-ab9c20db5b76fef2bc1add5a2ed31c2fb8ac78b2.tar.zst tangerine-wallet-browser-ab9c20db5b76fef2bc1add5a2ed31c2fb8ac78b2.zip |
Merge pull request #6021 from MetaMask/i5943-shapeshift-tx
Order shapeshift transactions by time within the transactions list
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/beta/metamask-beta-ui.spec.js | 31 | ||||
-rw-r--r-- | test/integration/lib/tx-list-items.js | 34 |
2 files changed, 36 insertions, 29 deletions
diff --git a/test/e2e/beta/metamask-beta-ui.spec.js b/test/e2e/beta/metamask-beta-ui.spec.js index 489b9b9da..942651fc8 100644 --- a/test/e2e/beta/metamask-beta-ui.spec.js +++ b/test/e2e/beta/metamask-beta-ui.spec.js @@ -635,7 +635,7 @@ describe('MetaMask', function () { await confirmButton.click() await delay(largeDelayMs) - driver.wait(async () => { + await driver.wait(async () => { const confirmedTxes = await findElements(driver, By.css('.transaction-list__completed-transactions .transaction-list-item')) return confirmedTxes.length === 4 }, 10000) @@ -695,7 +695,7 @@ describe('MetaMask', function () { await confirmButton.click() await delay(regularDelayMs) - driver.wait(async () => { + await driver.wait(async () => { const confirmedTxes = await findElements(driver, By.css('.transaction-list__completed-transactions .transaction-list-item')) return confirmedTxes.length === 5 }, 10000) @@ -727,7 +727,7 @@ describe('MetaMask', function () { await confirmButton.click() await delay(regularDelayMs) - driver.wait(async () => { + await driver.wait(async () => { const confirmedTxes = await findElements(driver, By.css('.transaction-list__completed-transactions .transaction-list-item')) return confirmedTxes.length === 6 }, 10000) @@ -911,7 +911,7 @@ describe('MetaMask', function () { await driver.wait(until.elementTextMatches(txValues[0], /-50\s*TST/), 10000) } - driver.wait(async () => { + await driver.wait(async () => { const confirmedTxes = await findElements(driver, By.css('.transaction-list__completed-transactions .transaction-list-item')) return confirmedTxes.length === 1 }, 10000) @@ -962,26 +962,29 @@ describe('MetaMask', function () { const [gasPriceInput, gasLimitInput] = await findElements(driver, By.css('.advanced-tab__gas-edit-row__input')) await gasPriceInput.clear() await delay(tinyDelayMs) + + await gasPriceInput.sendKeys(Key.BACK_SPACE) + await gasPriceInput.sendKeys(Key.BACK_SPACE) await gasPriceInput.sendKeys('10') await delay(tinyDelayMs) await gasLimitInput.clear() await delay(tinyDelayMs) await gasLimitInput.sendKeys(Key.chord(Key.CONTROL, 'a')) + await gasLimitInput.sendKeys(Key.BACK_SPACE) + await gasLimitInput.sendKeys(Key.BACK_SPACE) + await gasLimitInput.sendKeys(Key.BACK_SPACE) + await gasLimitInput.sendKeys(Key.BACK_SPACE) + await gasLimitInput.sendKeys(Key.BACK_SPACE) await gasLimitInput.sendKeys('60000') await gasLimitInput.sendKeys(Key.chord(Key.CONTROL, 'e')) - // Needed for different behaviour of input in different versions of firefox - const gasLimitInputValue = await gasLimitInput.getAttribute('value') - if (gasLimitInputValue === '600001') { - await gasLimitInput.sendKeys(Key.BACK_SPACE) - } - const save = await findElement(driver, By.css('.page-container__footer-button')) await save.click() await driver.wait(until.stalenessOf(gasModal)) const gasFeeInputs = await findElements(driver, By.css('.confirm-detail-row__primary')) - assert.equal(await gasFeeInputs[0].getText(), '0.0006') + const renderedGasFee = await gasFeeInputs[0].getText() + assert.equal(renderedGasFee, '0.0006') }) it('submits the transaction', async function () { @@ -991,7 +994,7 @@ describe('MetaMask', function () { }) it('finds the transaction in the transactions list', async function () { - driver.wait(async () => { + await driver.wait(async () => { const confirmedTxes = await findElements(driver, By.css('.transaction-list__completed-transactions .transaction-list-item')) return confirmedTxes.length === 2 }, 10000) @@ -1036,7 +1039,7 @@ describe('MetaMask', function () { await driver.switchTo().window(extension) await delay(regularDelayMs) - driver.wait(async () => { + await driver.wait(async () => { const pendingTxes = await findElements(driver, By.css('.transaction-list__pending-transactions .transaction-list-item')) return pendingTxes.length === 1 }, 10000) @@ -1116,7 +1119,7 @@ describe('MetaMask', function () { }) it('finds the transaction in the transactions list', async function () { - driver.wait(async () => { + await driver.wait(async () => { const confirmedTxes = await findElements(driver, By.css('.transaction-list__completed-transactions .transaction-list-item')) return confirmedTxes.length === 3 }, 10000) diff --git a/test/integration/lib/tx-list-items.js b/test/integration/lib/tx-list-items.js index ff196fac8..bf6f87937 100644 --- a/test/integration/lib/tx-list-items.js +++ b/test/integration/lib/tx-list-items.js @@ -16,7 +16,7 @@ QUnit.test('renders list items successfully', (assert) => { global.ethQuery = global.ethQuery || {} global.ethQuery.getTransactionCount = (_, cb) => { - cb(null, '0x3') + cb(null, '0x4') } async function runTxListItemsTest (assert, done) { @@ -30,25 +30,29 @@ async function runTxListItemsTest (assert, done) { metamaskLogo[0].click() const txListItems = await queryAsync($, '.transaction-list-item') - assert.equal(txListItems.length, 7, 'all tx list items are rendered') + assert.equal(txListItems.length, 8, 'all tx list items are rendered') - const approvedTx = txListItems[0] + const unapprovedMsg = txListItems[0] + const unapprovedMsgDescription = await findAsync($(unapprovedMsg), '.transaction-list-item__action') + assert.equal(unapprovedMsgDescription[0].textContent, 'Signature Request', 'unapprovedMsg has correct description') + + const approvedTx = txListItems[2] const approvedTxRenderedStatus = await findAsync($(approvedTx), '.transaction-list-item__status') assert.equal(approvedTxRenderedStatus[0].textContent, 'pending', 'approvedTx has correct label') - const unapprovedMsg = txListItems[1] - const unapprovedMsgDescription = await findAsync($(unapprovedMsg), '.transaction-list-item__action') - assert.equal(unapprovedMsgDescription[0].textContent, 'Signature Request', 'unapprovedMsg has correct description') + const confirmedTokenTx1 = txListItems[4] + const confirmedTokenTx1Address = await findAsync($(confirmedTokenTx1), '.transaction-list-item__status') + assert.equal(confirmedTokenTx1Address[0].textContent, 'Confirmed', 'confirmedTokenTx has correct status') - const shapeShiftTx = txListItems[4] - const shapeShiftTxStatus = await findAsync($(shapeShiftTx), '.flex-column div:eq(1)') - assert.equal(shapeShiftTxStatus[0].textContent, 'No deposits received', 'shapeShiftTx has correct status') + const shapeShiftTx1 = txListItems[5] + const shapeShiftTx1Status = await findAsync($(shapeShiftTx1), '.flex-column div:eq(1)') + assert.equal(shapeShiftTx1Status[0].textContent, 'No deposits received', 'shapeShiftTx has correct status') - const rejectedTx = txListItems[5] - const rejectedTxRenderedStatus = await findAsync($(rejectedTx), '.transaction-list-item__status') - assert.equal(rejectedTxRenderedStatus[0].textContent, 'Rejected', 'rejectedTx has correct label') + const confirmedTokenTx2 = txListItems[6] + const confirmedTokenTx2Address = await findAsync($(confirmedTokenTx2), '.transaction-list-item__status') + assert.equal(confirmedTokenTx2Address[0].textContent, 'Confirmed', 'confirmedTokenTx has correct status') - const confirmedTokenTx = txListItems[6] - const confirmedTokenTxAddress = await findAsync($(confirmedTokenTx), '.transaction-list-item__status') - assert.equal(confirmedTokenTxAddress[0].textContent, 'Confirmed', 'confirmedTokenTx has correct address') + const shapeShiftTx2 = txListItems[7] + const shapeShiftTx2Address = await findAsync($(shapeShiftTx2), '.flex-column div:eq(1)') + assert.equal(shapeShiftTx2Address[0].textContent, 'No deposits received', 'shapeShiftTx has correct status') } |