aboutsummaryrefslogtreecommitdiffstats
path: root/test/e2e/beta/metamask-beta-ui.spec.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-06-19 23:44:01 +0800
committerDan <danjm.com@gmail.com>2018-06-27 21:31:26 +0800
commitb64292d92fccafe2cf99279bb170c486d2c3515c (patch)
treec5a8e89e5c7b51517c7d83167860771819175069 /test/e2e/beta/metamask-beta-ui.spec.js
parent309239afb402e7729184ff7c5956497263b4e0b8 (diff)
downloadtangerine-wallet-browser-b64292d92fccafe2cf99279bb170c486d2c3515c.tar
tangerine-wallet-browser-b64292d92fccafe2cf99279bb170c486d2c3515c.tar.gz
tangerine-wallet-browser-b64292d92fccafe2cf99279bb170c486d2c3515c.tar.bz2
tangerine-wallet-browser-b64292d92fccafe2cf99279bb170c486d2c3515c.tar.lz
tangerine-wallet-browser-b64292d92fccafe2cf99279bb170c486d2c3515c.tar.xz
tangerine-wallet-browser-b64292d92fccafe2cf99279bb170c486d2c3515c.tar.zst
tangerine-wallet-browser-b64292d92fccafe2cf99279bb170c486d2c3515c.zip
Update metamask-beta-ui e2e spec to fail on insufficient gas estimation.
Diffstat (limited to 'test/e2e/beta/metamask-beta-ui.spec.js')
-rw-r--r--test/e2e/beta/metamask-beta-ui.spec.js38
1 files changed, 31 insertions, 7 deletions
diff --git a/test/e2e/beta/metamask-beta-ui.spec.js b/test/e2e/beta/metamask-beta-ui.spec.js
index 548515760..a86881877 100644
--- a/test/e2e/beta/metamask-beta-ui.spec.js
+++ b/test/e2e/beta/metamask-beta-ui.spec.js
@@ -485,6 +485,7 @@ describe('MetaMask', function () {
await delay(regularDelayMs)
let gasModal = await driver.findElement(By.css('span .modal'))
+ await driver.wait(until.elementLocated('send-v2__customize-gas__title'))
const [gasPriceInput, gasLimitInput] = await findElements(driver, By.css('.customize-gas-input'))
await gasPriceInput.clear()
@@ -612,12 +613,7 @@ describe('MetaMask', function () {
})
it('customizes gas', async () => {
- const [gasPriceInput, gasLimitInput] = await findElements(driver, By.css('.customize-gas-input'))
- await gasPriceInput.clear()
- await gasPriceInput.sendKeys('12.5')
- await gasLimitInput.clear()
- await gasLimitInput.sendKeys('56789')
-
+ await driver.wait(until.elementLocated(By.css('.send-v2__customize-gas__title')))
const save = await findElement(driver, By.xpath(`//button[contains(text(), 'Save')]`))
await save.click()
await delay(regularDelayMs)
@@ -646,11 +642,13 @@ describe('MetaMask', function () {
assert.equal(txValues.length, 1)
assert.equal(await txValues[0].getText(), '50 TST')
const txStatuses = await findElements(driver, By.css('.tx-list-status'))
- await driver.wait(until.elementTextMatches(txStatuses[0], /Confirmed/))
+ const tx = await driver.wait(until.elementTextMatches(txStatuses[0], /Confirmed|Failed/))
+ assert.equal(await tx.getText(), 'Confirmed')
})
})
describe('Send a custom token from TokenFactory', () => {
+ let gasModal
it('sends an already created token', async () => {
await driver.executeScript(`window.open("https://tokenfactory.surge.sh/#/token/${tokenAddress}")`)
await delay(waitingNewPageDelayMs)
@@ -673,6 +671,32 @@ describe('MetaMask', function () {
await loadExtension(driver, extensionId)
await delay(regularDelayMs)
+ // Set the gas limit
+ const configureGas = await driver.wait(until.elementLocated(By.css('.send-v2__gas-fee-display button')))
+ await configureGas.click()
+ await delay(regularDelayMs)
+
+ gasModal = await driver.findElement(By.css('span .modal'))
+ })
+
+ it('customizes gas', async () => {
+ await driver.wait(until.elementLocated(By.css('.send-v2__customize-gas__title')))
+
+ const [gasPriceInput, gasLimitInput] = await findElements(driver, By.css('.customize-gas-input'))
+ await gasPriceInput.clear()
+ await gasPriceInput.sendKeys('10')
+ await gasLimitInput.clear()
+ await gasLimitInput.sendKeys('60000')
+
+ const save = await findElement(driver, By.xpath(`//button[contains(text(), 'Save')]`))
+ await save.click()
+ await driver.wait(until.stalenessOf(gasModal))
+
+ const gasFeeInput = await findElement(driver, By.css('.currency-display__input'))
+ assert.equal(await gasFeeInput.getAttribute('value'), 0.0006)
+ })
+
+ it('submits the transaction', async function () {
const confirmButton = await findElement(driver, By.xpath(`//button[contains(text(), 'Confirm')]`))
await confirmButton.click()
await delay(regularDelayMs)