aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorWhymarrh Whitby <whymarrh.whitby@gmail.com>2019-02-08 22:22:19 +0800
committerWhymarrh Whitby <whymarrh.whitby@gmail.com>2019-02-09 03:14:45 +0800
commit0972e23dcd9c15abe9a3229f9514b3b2f1ccd673 (patch)
tree47dcdba550c9b070a9a3d0d056fa50c93ef429c8 /test
parent57ead4914f6f9fd1fe47b865559e4908a36f6a8a (diff)
downloadtangerine-wallet-browser-0972e23dcd9c15abe9a3229f9514b3b2f1ccd673.tar
tangerine-wallet-browser-0972e23dcd9c15abe9a3229f9514b3b2f1ccd673.tar.gz
tangerine-wallet-browser-0972e23dcd9c15abe9a3229f9514b3b2f1ccd673.tar.bz2
tangerine-wallet-browser-0972e23dcd9c15abe9a3229f9514b3b2f1ccd673.tar.lz
tangerine-wallet-browser-0972e23dcd9c15abe9a3229f9514b3b2f1ccd673.tar.xz
tangerine-wallet-browser-0972e23dcd9c15abe9a3229f9514b3b2f1ccd673.tar.zst
tangerine-wallet-browser-0972e23dcd9c15abe9a3229f9514b3b2f1ccd673.zip
Add e2e tests adjusting gas before sending
Diffstat (limited to 'test')
-rw-r--r--test/e2e/beta/metamask-beta-ui.spec.js100
1 files changed, 90 insertions, 10 deletions
diff --git a/test/e2e/beta/metamask-beta-ui.spec.js b/test/e2e/beta/metamask-beta-ui.spec.js
index 942651fc8..a824763e0 100644
--- a/test/e2e/beta/metamask-beta-ui.spec.js
+++ b/test/e2e/beta/metamask-beta-ui.spec.js
@@ -352,7 +352,87 @@ describe('MetaMask', function () {
})
})
- describe('Send ETH from inside MetaMask', () => {
+ describe('Send ETH from inside MetaMask using default gas', () => {
+ it('starts a send 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('.unit-input__input'))
+ await inputAddress.sendKeys('0x2f318C334780961FB129D2a6c30D0763d9a5C970')
+ await inputAmount.sendKeys('1')
+
+ const inputValue = await inputAmount.getAttribute('value')
+ assert.equal(inputValue, '1')
+ 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(largeDelayMs)
+ })
+
+ it('finds the transaction in the transactions list', async function () {
+ const transactions = await findElements(driver, By.css('.transaction-list-item'))
+ assert.equal(transactions.length, 1)
+
+ if (process.env.SELENIUM_BROWSER !== 'firefox') {
+ const txValues = await findElement(driver, By.css('.transaction-list-item__amount--primary'))
+ await driver.wait(until.elementTextMatches(txValues, /-1\s*ETH/), 10000)
+ }
+ })
+ })
+
+ describe('Send ETH from inside MetaMask using fast gas option', () => {
+ it('starts a send 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('.unit-input__input'))
+ await inputAddress.sendKeys('0x2f318C334780961FB129D2a6c30D0763d9a5C970')
+ await inputAmount.sendKeys('1')
+
+ const inputValue = await inputAmount.getAttribute('value')
+ assert.equal(inputValue, '1')
+
+ // Set the gas price
+ const fastGas = await findElement(driver, By.xpath(`//button/div/div[contains(text(), "Fast")]`))
+ await fastGas.click()
+ 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(largeDelayMs)
+ })
+
+ it('finds the transaction in the transactions list', async function () {
+ const transactions = await findElements(driver, By.css('.transaction-list-item'))
+ assert.equal(transactions.length, 2)
+
+ if (process.env.SELENIUM_BROWSER !== 'firefox') {
+ const txValues = await findElement(driver, By.css('.transaction-list-item__amount--primary'))
+ await driver.wait(until.elementTextMatches(txValues, /-1\s*ETH/), 10000)
+ }
+ })
+ })
+
+ describe('Send ETH from inside MetaMask using advanced gas modal', () => {
it('starts a send transaction', async function () {
const sendButton = await findElement(driver, By.xpath(`//button[contains(text(), 'Send')]`))
await sendButton.click()
@@ -391,7 +471,7 @@ describe('MetaMask', function () {
it('finds the transaction in the transactions list', async function () {
const transactions = await findElements(driver, By.css('.transaction-list-item'))
- assert.equal(transactions.length, 1)
+ assert.equal(transactions.length, 3)
if (process.env.SELENIUM_BROWSER !== 'firefox') {
const txValues = await findElement(driver, By.css('.transaction-list-item__amount--primary'))
@@ -447,7 +527,7 @@ describe('MetaMask', function () {
it('finds the transaction in the transactions list', async function () {
const transactions = await findElements(driver, By.css('.transaction-list-item'))
- assert.equal(transactions.length, 2)
+ assert.equal(transactions.length, 4)
const txValues = await findElement(driver, By.css('.transaction-list-item__amount--primary'))
await driver.wait(until.elementTextMatches(txValues, /-3\s*ETH/), 10000)
@@ -487,7 +567,7 @@ describe('MetaMask', function () {
})
it('navigates the transactions', async () => {
- let navigateTxButtons = await findElements(driver, By.css('.confirm-page-container-navigation__arrow'))
+ let navigateTxButtons = await findElements(driver, By.css('.confirm-page-container-navigation__arrow'), 20000)
assert.equal(navigateTxButtons.length, 4, 'navigation button present')
await navigateTxButtons[2].click()
@@ -586,7 +666,7 @@ describe('MetaMask', function () {
await delay(largeDelayMs * 2)
const confirmedTxes = await findElements(driver, By.css('.transaction-list__completed-transactions .transaction-list-item'))
- assert.equal(confirmedTxes.length, 3, '3 transactions present')
+ assert.equal(confirmedTxes.length, 5, '5 transactions present')
})
})
@@ -637,7 +717,7 @@ describe('MetaMask', function () {
await driver.wait(async () => {
const confirmedTxes = await findElements(driver, By.css('.transaction-list__completed-transactions .transaction-list-item'))
- return confirmedTxes.length === 4
+ return confirmedTxes.length === 6
}, 10000)
const txAction = await findElements(driver, By.css('.transaction-list-item__action'))
@@ -697,7 +777,7 @@ describe('MetaMask', function () {
await driver.wait(async () => {
const confirmedTxes = await findElements(driver, By.css('.transaction-list__completed-transactions .transaction-list-item'))
- return confirmedTxes.length === 5
+ return confirmedTxes.length === 7
}, 10000)
const txValues = await findElements(driver, By.css('.transaction-list-item__amount--primary'))
@@ -729,7 +809,7 @@ describe('MetaMask', function () {
await driver.wait(async () => {
const confirmedTxes = await findElements(driver, By.css('.transaction-list__completed-transactions .transaction-list-item'))
- return confirmedTxes.length === 6
+ return confirmedTxes.length === 8
}, 10000)
const txValues = await findElement(driver, By.css('.transaction-list-item__amount--primary'))
@@ -743,9 +823,9 @@ describe('MetaMask', function () {
const balance = await findElement(driver, By.css('.transaction-view-balance__primary-balance'))
await delay(regularDelayMs)
if (process.env.SELENIUM_BROWSER !== 'firefox') {
- await driver.wait(until.elementTextMatches(balance, /^89.*\s*ETH.*$/), 10000)
+ await driver.wait(until.elementTextMatches(balance, /^87.*\s*ETH.*$/), 10000)
const tokenAmount = await balance.getText()
- assert.ok(/^89.*\s*ETH.*$/.test(tokenAmount))
+ assert.ok(/^87.*\s*ETH.*$/.test(tokenAmount))
await delay(regularDelayMs)
}
})