aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan J Miller <danjm.com@gmail.com>2019-02-13 22:03:14 +0800
committerWhymarrh Whitby <whymarrh.whitby@gmail.com>2019-02-13 22:03:14 +0800
commitf7ab4577f637dd9e96cec0f08848bc70c489f9d3 (patch)
tree142a6f036f42304bbd6a5020d9e83ae208637b16
parentd438deee890022d6066e9c4798e61907ff23b535 (diff)
downloadtangerine-wallet-browser-f7ab4577f637dd9e96cec0f08848bc70c489f9d3.tar
tangerine-wallet-browser-f7ab4577f637dd9e96cec0f08848bc70c489f9d3.tar.gz
tangerine-wallet-browser-f7ab4577f637dd9e96cec0f08848bc70c489f9d3.tar.bz2
tangerine-wallet-browser-f7ab4577f637dd9e96cec0f08848bc70c489f9d3.tar.lz
tangerine-wallet-browser-f7ab4577f637dd9e96cec0f08848bc70c489f9d3.tar.xz
tangerine-wallet-browser-f7ab4577f637dd9e96cec0f08848bc70c489f9d3.tar.zst
tangerine-wallet-browser-f7ab4577f637dd9e96cec0f08848bc70c489f9d3.zip
Adds tests for advanced gas controls on confim screen (#6144)
-rw-r--r--test/e2e/beta/metamask-beta-ui.spec.js48
1 files changed, 47 insertions, 1 deletions
diff --git a/test/e2e/beta/metamask-beta-ui.spec.js b/test/e2e/beta/metamask-beta-ui.spec.js
index a824763e0..bde031301 100644
--- a/test/e2e/beta/metamask-beta-ui.spec.js
+++ b/test/e2e/beta/metamask-beta-ui.spec.js
@@ -480,12 +480,36 @@ describe('MetaMask', function () {
})
})
- describe('Send ETH from dapp', () => {
+ describe('Send ETH from dapp using advanced gas controls', () => {
let windowHandles
let extension
let popup
let dapp
+ it('goes to the settings screen', async () => {
+ await driver.findElement(By.css('.account-menu__icon')).click()
+ await delay(regularDelayMs)
+
+ const settingsButton = await findElement(driver, By.xpath(`//div[contains(text(), 'Settings')]`))
+ settingsButton.click()
+
+ await findElement(driver, By.css('.tab-bar'))
+
+ const advancedGasTitle = await findElement(driver, By.xpath(`//span[contains(text(), 'Advanced gas controls')]`))
+ await driver.executeScript('arguments[0].scrollIntoView(true)', advancedGasTitle)
+
+ const advancedGasToggle = await findElement(driver, By.css('.settings-page__content-row:nth-of-type(11) .settings-page__content-item-col > div'))
+ await advancedGasToggle.click()
+ windowHandles = await driver.getAllWindowHandles()
+ extension = windowHandles[0]
+ await closeAllWindowHandlesExcept(driver, [extension])
+
+ const metamaskHomeButton = await findElement(driver, By.css('.app-header__logo-container'))
+ await metamaskHomeButton.click()
+
+ await delay(largeDelayMs)
+ })
+
it('starts a send transaction inside the dapp', async () => {
await openNewPage(driver, 'http://127.0.0.1:8080/')
await delay(regularDelayMs)
@@ -516,6 +540,17 @@ describe('MetaMask', function () {
await assertElementNotPresent(webdriver, driver, By.xpath(`//li[contains(text(), 'Data')]`))
+ const [gasPriceInput, gasLimitInput] = await findElements(driver, By.css('.advanced-gas-inputs__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.sendKeys('5')
+ await delay(tinyDelayMs)
+
const confirmButton = await findElement(driver, By.xpath(`//button[contains(text(), 'Confirm')]`), 10000)
await confirmButton.click()
await delay(regularDelayMs)
@@ -532,6 +567,17 @@ describe('MetaMask', function () {
const txValues = await findElement(driver, By.css('.transaction-list-item__amount--primary'))
await driver.wait(until.elementTextMatches(txValues, /-3\s*ETH/), 10000)
})
+
+ it('the transaction has the expected gas price', async function () {
+ const txValues = await findElement(driver, By.css('.transaction-list-item__amount--primary'))
+ await txValues.click()
+ await delay(tinyDelayMs)
+ await findElement(driver, By.xpath(`//div[contains(text(), 'Gas Price (GWEI)')]`))
+
+ await findElement(driver, By.xpath(`//span[contains(text(), '7')]`))
+
+ txValues.click()
+ })
})
describe('Navigate transactions', () => {