aboutsummaryrefslogtreecommitdiffstats
path: root/test/e2e/beta/metamask-beta-ui.spec.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-07-10 00:08:05 +0800
committerDan <danjm.com@gmail.com>2018-07-11 03:48:16 +0800
commit228b8072218a27fe45867018152392ffb2012251 (patch)
tree0519197f86fc2c39d9c216a0fe41157a7a5882e7 /test/e2e/beta/metamask-beta-ui.spec.js
parent1a0a701de0fe97386a5acb666c4a4e123f27af94 (diff)
downloadtangerine-wallet-browser-228b8072218a27fe45867018152392ffb2012251.tar
tangerine-wallet-browser-228b8072218a27fe45867018152392ffb2012251.tar.gz
tangerine-wallet-browser-228b8072218a27fe45867018152392ffb2012251.tar.bz2
tangerine-wallet-browser-228b8072218a27fe45867018152392ffb2012251.tar.lz
tangerine-wallet-browser-228b8072218a27fe45867018152392ffb2012251.tar.xz
tangerine-wallet-browser-228b8072218a27fe45867018152392ffb2012251.tar.zst
tangerine-wallet-browser-228b8072218a27fe45867018152392ffb2012251.zip
Fix existing e2e tests
Diffstat (limited to 'test/e2e/beta/metamask-beta-ui.spec.js')
-rw-r--r--test/e2e/beta/metamask-beta-ui.spec.js37
1 files changed, 26 insertions, 11 deletions
diff --git a/test/e2e/beta/metamask-beta-ui.spec.js b/test/e2e/beta/metamask-beta-ui.spec.js
index 69bcf8901..61738af00 100644
--- a/test/e2e/beta/metamask-beta-ui.spec.js
+++ b/test/e2e/beta/metamask-beta-ui.spec.js
@@ -196,8 +196,20 @@ describe('MetaMask', function () {
await delay(regularDelayMs)
})
- async function retypeSeedPhrase (words) {
+ async function retypeSeedPhrase (words, wasReloaded) {
try {
+ if (wasReloaded) {
+ const byRevealButton = By.css('.backup-phrase__secret-blocker .backup-phrase__reveal-button')
+ await driver.wait(until.elementLocated(byRevealButton, 10000))
+ const revealSeedPhraseButton = await findElement(driver, byRevealButton, 10000)
+ await revealSeedPhraseButton.click()
+ await delay(regularDelayMs)
+
+ const nextScreen = await findElement(driver, By.css('.backup-phrase button'))
+ await nextScreen.click()
+ await delay(regularDelayMs)
+ }
+
const word0 = await findElement(driver, By.xpath(`//button[contains(text(), '${words[0]}')]`), 10000)
await word0.click()
@@ -258,7 +270,7 @@ describe('MetaMask', function () {
await delay(tinyDelayMs)
} catch (e) {
await loadExtension(driver, extensionId)
- await retypeSeedPhrase(words)
+ await retypeSeedPhrase(words, true)
}
}
@@ -311,7 +323,7 @@ describe('MetaMask', function () {
it('accepts the account password after lock', async () => {
await driver.findElement(By.id('password')).sendKeys('correct horse battery staple')
await driver.findElement(By.id('password')).sendKeys(Key.ENTER)
- await delay(regularDelayMs * 4)
+ await delay(largeDelayMs * 4)
})
})
@@ -390,6 +402,9 @@ describe('MetaMask', function () {
await inputAddress.sendKeys('0x2f318C334780961FB129D2a6c30D0763d9a5C970')
await inputAmount.sendKeys('1')
+ const inputValue = await inputAmount.getAttribute('value')
+ assert.equal(inputValue, '1')
+
// Set the gas limit
const configureGas = await findElement(driver, By.css('.send-v2__gas-fee-display button'))
await configureGas.click()
@@ -515,12 +530,12 @@ describe('MetaMask', function () {
await delay(regularDelayMs)
// Set the gas limit
- const configureGas = await findElement(driver, By.css('.sliders-icon-container'))
+ const configureGas = await findElement(driver, By.css('.confirm-detail-row__header-text--edit'))
await configureGas.click()
await delay(regularDelayMs)
const gasModal = await driver.findElement(By.css('span .modal'))
- await driver.wait(until.elementLocated(By.css('.send-v2__customize-gas__title')))
+ await driver.wait(until.elementLocated(By.css('.customize-gas__title')))
const [gasPriceInput, gasLimitInput] = await findElements(driver, By.css('.customize-gas-input'))
await gasPriceInput.clear()
@@ -680,7 +695,7 @@ describe('MetaMask', function () {
gasModal = await driver.findElement(By.css('span .modal'))
})
- it('customizes gas', async () => {
+ it('opens customizes gas modal', async () => {
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()
@@ -747,7 +762,7 @@ describe('MetaMask', function () {
await delay(regularDelayMs)
// Set the gas limit
- const configureGas = await driver.wait(until.elementLocated(By.css('.send-v2__gas-fee-display button')))
+ const configureGas = await driver.wait(until.elementLocated(By.css('.confirm-detail-row__header-text--edit')))
await configureGas.click()
await delay(regularDelayMs)
@@ -755,7 +770,7 @@ describe('MetaMask', function () {
})
it('customizes gas', async () => {
- await driver.wait(until.elementLocated(By.css('.send-v2__customize-gas__title')))
+ await driver.wait(until.elementLocated(By.css('.customize-gas__title')))
const [gasPriceInput, gasLimitInput] = await findElements(driver, By.css('.customize-gas-input'))
await gasPriceInput.clear()
@@ -774,12 +789,12 @@ describe('MetaMask', function () {
await gasLimitInput.sendKeys(Key.BACK_SPACE)
}
- const save = await findElement(driver, By.css('.send-v2__customize-gas__save'))
+ const save = await findElement(driver, By.css('.customize-gas__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)
+ const gasFeeInputs = await findElements(driver, By.css('.confirm-detail-row__eth'))
+ assert.equal(await gasFeeInputs[0].getText(), '♦ 0.0006')
})
it('submits the transaction', async function () {