aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-06-08 21:46:47 +0800
committerDan <danjm.com@gmail.com>2018-06-27 21:30:42 +0800
commit9734e6ffb8d45cf5268e73a76c29948fad129205 (patch)
tree7865ce52d8e337deab1426e305146ba2b67f8bd6
parent9cb15d44a055399c320d4544a2c71ffb7bf152c9 (diff)
downloadtangerine-wallet-browser-9734e6ffb8d45cf5268e73a76c29948fad129205.tar
tangerine-wallet-browser-9734e6ffb8d45cf5268e73a76c29948fad129205.tar.gz
tangerine-wallet-browser-9734e6ffb8d45cf5268e73a76c29948fad129205.tar.bz2
tangerine-wallet-browser-9734e6ffb8d45cf5268e73a76c29948fad129205.tar.lz
tangerine-wallet-browser-9734e6ffb8d45cf5268e73a76c29948fad129205.tar.xz
tangerine-wallet-browser-9734e6ffb8d45cf5268e73a76c29948fad129205.tar.zst
tangerine-wallet-browser-9734e6ffb8d45cf5268e73a76c29948fad129205.zip
metamask-beta-ui.spec.js tests custom token send before searched token.
-rw-r--r--test/e2e/beta/metamask-beta-ui.spec.js81
1 files changed, 43 insertions, 38 deletions
diff --git a/test/e2e/beta/metamask-beta-ui.spec.js b/test/e2e/beta/metamask-beta-ui.spec.js
index add730271..2d41d80cc 100644
--- a/test/e2e/beta/metamask-beta-ui.spec.js
+++ b/test/e2e/beta/metamask-beta-ui.spec.js
@@ -160,8 +160,9 @@ describe('MetaMask', function () {
let seedPhrase
it('reveals the seed phrase', async () => {
- const revealSeedPhrase = await findElement(driver, By.css('.backup-phrase__secret-blocker'), 14000)
- await revealSeedPhrase.click()
+ await driver.wait(until.elementIsVisible(By.css('.backup-phrase__reveal-button')))
+ const revealSeedPhraseButton = await findElement(driver, By.css('.backup-phrase__reveal-button'), 10000)
+ await revealSeedPhraseButton.click()
await delay(regularDelayMs)
seedPhrase = await driver.findElement(By.css('.backup-phrase__secret-words')).getText()
@@ -405,40 +406,6 @@ describe('MetaMask', function () {
})
})
- describe('Add existing token using search', () => {
- it('clicks on the Add Token button', async () => {
- const addToken = await findElement(driver, By.xpath(`//button[contains(text(), 'Add Token')]`))
- await addToken.click()
- await delay(regularDelayMs)
- })
-
- it('can pick a token from the existing options', async () => {
- const tokenSearch = await findElement(driver, By.css('#search-tokens'))
- await tokenSearch.sendKeys('BAT')
- await delay(regularDelayMs)
-
- const token = await findElement(driver, By.xpath("//span[contains(text(), 'BAT')]"))
- await token.click()
- await delay(regularDelayMs)
-
- const nextScreen = await findElement(driver, By.xpath(`//button[contains(text(), 'Next')]`))
- await nextScreen.click()
- await delay(regularDelayMs)
-
- const addTokens = await findElement(driver, By.xpath(`//button[contains(text(), 'Add Tokens')]`))
- await addTokens.click()
- await delay(largeDelayMs)
- })
-
- it('renders the balance for the chosen token', async () => {
- const balance = await findElement(driver, By.css('.tx-view .balance-display .token-amount'))
- await driver.wait(until.elementTextMatches(balance, /^0\s*BAT\s*$/), 10000)
- const tokenAmount = await balance.getText()
- assert.ok(/^0\s*BAT\s*$/.test(tokenAmount))
- await delay(regularDelayMs)
- })
- })
-
describe('Add a custom token from TokenFactory', () => {
it('creates a new token', async () => {
await driver.executeScript('window.open("https://tokenfactory.surge.sh/#/factory")')
@@ -710,10 +677,48 @@ describe('MetaMask', function () {
assert.equal(txValues.length, 5)
assert.equal(await txValues[0].getText(), '26 TST')
const txStatuses = await findElements(driver, By.css('.tx-list-status'))
- await driver.wait(until.elementTextMatches(txStatuses[1], /Confirmed/))
+ await driver.wait(until.elementTextMatches(txStatuses[0], /Confirmed/))
+
+ const tokenListItems = await findElements(driver, By.css('.token-list-item'))
+ tokenListItems[0].click()
+ await delay(regularDelayMs)
const tokenBalanceAmount = await findElement(driver, By.css('.token-balance__amount'))
- assert.equal(tokenBalanceAmount.getText(), '24 TST')
+ assert.equal(await tokenBalanceAmount.getText(), '24')
+ })
+ })
+
+ describe('Add existing token using search', () => {
+ it('clicks on the Add Token button', async () => {
+ const addToken = await findElement(driver, By.xpath(`//button[contains(text(), 'Add Token')]`))
+ await addToken.click()
+ await delay(regularDelayMs)
+ })
+
+ it('can pick a token from the existing options', async () => {
+ const tokenSearch = await findElement(driver, By.css('#search-tokens'))
+ await tokenSearch.sendKeys('BAT')
+ await delay(regularDelayMs)
+
+ const token = await findElement(driver, By.xpath("//span[contains(text(), 'BAT')]"))
+ await token.click()
+ await delay(regularDelayMs)
+
+ const nextScreen = await findElement(driver, By.xpath(`//button[contains(text(), 'Next')]`))
+ await nextScreen.click()
+ await delay(regularDelayMs)
+
+ const addTokens = await findElement(driver, By.xpath(`//button[contains(text(), 'Add Tokens')]`))
+ await addTokens.click()
+ await delay(largeDelayMs)
+ })
+
+ it('renders the balance for the chosen token', async () => {
+ const balance = await findElement(driver, By.css('.tx-view .balance-display .token-amount'))
+ await driver.wait(until.elementTextIs(balance, '0BAT'))
+ const tokenAmount = await balance.getText()
+ assert.equal(tokenAmount, '0BAT')
+ await delay(regularDelayMs)
})
})
})