aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-06-07 20:37:41 +0800
committerDan <danjm.com@gmail.com>2018-06-27 21:28:55 +0800
commit67894ef2e282f67539c4e7e00b1014f3854db8e0 (patch)
tree5bef9c46a964908654eb70de57a6f9a626de079a /test
parentf82e4439d0e6e17d87525e01de4f0a6a175a84e5 (diff)
downloadtangerine-wallet-browser-67894ef2e282f67539c4e7e00b1014f3854db8e0.tar
tangerine-wallet-browser-67894ef2e282f67539c4e7e00b1014f3854db8e0.tar.gz
tangerine-wallet-browser-67894ef2e282f67539c4e7e00b1014f3854db8e0.tar.bz2
tangerine-wallet-browser-67894ef2e282f67539c4e7e00b1014f3854db8e0.tar.lz
tangerine-wallet-browser-67894ef2e282f67539c4e7e00b1014f3854db8e0.tar.xz
tangerine-wallet-browser-67894ef2e282f67539c4e7e00b1014f3854db8e0.tar.zst
tangerine-wallet-browser-67894ef2e282f67539c4e7e00b1014f3854db8e0.zip
Adds e2e tests for sending tokens within metamask.
Diffstat (limited to 'test')
-rw-r--r--test/e2e/beta/metamask-beta-ui.spec.js44
1 files changed, 44 insertions, 0 deletions
diff --git a/test/e2e/beta/metamask-beta-ui.spec.js b/test/e2e/beta/metamask-beta-ui.spec.js
index 68cc17bc2..bbebecc39 100644
--- a/test/e2e/beta/metamask-beta-ui.spec.js
+++ b/test/e2e/beta/metamask-beta-ui.spec.js
@@ -614,4 +614,48 @@ describe('MetaMask', function () {
assert.equal(tokenBalanceAmount.getText(), '24 TST')
})
})
+
+ describe('Send token from inside MetaMask', () => {
+ it('starts to send a transaction', async function () {
+ const sendButton = await findElement(driver, By.xpath(`//button[contains(text(), 'Send')]`))
+ await sendButton.click()
+ await delay(regularDelayMs)
+
+ const inputAddress = await findElement(driver, By.css('input[placeholder="Recipient Address"]'))
+ const inputAmount = await findElement(driver, By.css('.currency-display__input'))
+ await inputAddress.sendKeys('0x2f318C334780961FB129D2a6c30D0763d9a5C970')
+ await inputAmount.sendKeys('50')
+
+ // Set the gas limit
+ const configureGas = await findElement(driver, By.css('.send-v2__gas-fee-display button'))
+ await configureGas.click()
+ await delay(regularDelayMs)
+
+ const gasModal = await driver.findElement(By.css('span .modal'))
+ const save = await findElement(driver, By.xpath(`//button[contains(text(), 'Save')]`))
+ await save.click()
+ await driver.wait(until.stalenessOf(gasModal))
+ await delay(regularDelayMs)
+
+ // Continue to next screen
+ const nextScreen = await findElement(driver, By.xpath(`//button[contains(text(), 'Next')]`))
+ await nextScreen.click()
+ await delay(regularDelayMs)
+ })
+
+ it('confirms the transaction', async function () {
+ const confirmButton = await findElement(driver, By.xpath(`//button[contains(text(), 'Confirm')]`))
+ await confirmButton.click()
+ await delay(regularDelayMs)
+ })
+
+ it('finds the transaction in the transactions list', async function () {
+ const transactions = await findElements(driver, By.css('.tx-list-item'))
+ assert.equal(transactions.length, 1)
+
+ const txValues = await findElements(driver, By.css('.tx-list-value'))
+ assert.equal(txValues.length, 1)
+ assert.equal(await txValues[0].getText(), '50 TST')
+ })
+ })
})