aboutsummaryrefslogtreecommitdiffstats
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:15:36 +0800
commit73894fb5bde4548395e584bbab199c3b6dc86cc1 (patch)
tree9632e63ea7bb83558f5f5058fa8ed2f7419a561c
parent60feeb393be5d84679dd7b94dba58540ffa166bd (diff)
downloadtangerine-wallet-browser-73894fb5bde4548395e584bbab199c3b6dc86cc1.tar
tangerine-wallet-browser-73894fb5bde4548395e584bbab199c3b6dc86cc1.tar.gz
tangerine-wallet-browser-73894fb5bde4548395e584bbab199c3b6dc86cc1.tar.bz2
tangerine-wallet-browser-73894fb5bde4548395e584bbab199c3b6dc86cc1.tar.lz
tangerine-wallet-browser-73894fb5bde4548395e584bbab199c3b6dc86cc1.tar.xz
tangerine-wallet-browser-73894fb5bde4548395e584bbab199c3b6dc86cc1.tar.zst
tangerine-wallet-browser-73894fb5bde4548395e584bbab199c3b6dc86cc1.zip
Adds e2e tests for sending tokens within metamask.
-rw-r--r--test/e2e/beta/metamask-beta-ui.spec.js50
1 files changed, 48 insertions, 2 deletions
diff --git a/test/e2e/beta/metamask-beta-ui.spec.js b/test/e2e/beta/metamask-beta-ui.spec.js
index 71329bff7..58979ce7e 100644
--- a/test/e2e/beta/metamask-beta-ui.spec.js
+++ b/test/e2e/beta/metamask-beta-ui.spec.js
@@ -160,7 +160,7 @@ describe('MetaMask', function () {
let seedPhrase
it('reveals the seed phrase', async () => {
- const revealSeedPhrase = await findElement(driver, By.css('.backup-phrase__secret-blocker'))
+ const revealSeedPhrase = await findElement(driver, By.css('.backup-phrase__secret-blocker'), 14000)
await revealSeedPhrase.click()
await delay(regularDelayMs)
@@ -230,7 +230,7 @@ describe('MetaMask', function () {
})
it('clicks through the deposit modal', async () => {
- const buyModal = await driver.findElement(By.css('span .modal'))
+ const buyModal = await findElement(driver, By.css('span .modal'))
const closeModal = await findElement(driver, By.css('.page-container__header-close'))
await closeModal.click()
await driver.wait(until.stalenessOf(buyModal))
@@ -345,8 +345,10 @@ describe('MetaMask', function () {
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
@@ -510,4 +512,48 @@ describe('MetaMask', function () {
await delay(regularDelayMs)
})
})
+
+ 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')
+ })
+ })
})