aboutsummaryrefslogtreecommitdiffstats
path: root/test/e2e
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-06-23 03:36:22 +0800
committerDan <danjm.com@gmail.com>2018-06-27 21:38:17 +0800
commit31bb8a0ab773449aae302a229489b5816fdb093c (patch)
tree62e4b70081e79452c1eb48f07387af4856c1d7da /test/e2e
parenta6cb13422de26e7d6bcecda03fb4756d3bf6ed67 (diff)
downloadtangerine-wallet-browser-31bb8a0ab773449aae302a229489b5816fdb093c.tar
tangerine-wallet-browser-31bb8a0ab773449aae302a229489b5816fdb093c.tar.gz
tangerine-wallet-browser-31bb8a0ab773449aae302a229489b5816fdb093c.tar.bz2
tangerine-wallet-browser-31bb8a0ab773449aae302a229489b5816fdb093c.tar.lz
tangerine-wallet-browser-31bb8a0ab773449aae302a229489b5816fdb093c.tar.xz
tangerine-wallet-browser-31bb8a0ab773449aae302a229489b5816fdb093c.tar.zst
tangerine-wallet-browser-31bb8a0ab773449aae302a229489b5816fdb093c.zip
Add try catch to deal with false negative timeouts in beta e2e tests.
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/beta/metamask-beta-ui.spec.js29
1 files changed, 22 insertions, 7 deletions
diff --git a/test/e2e/beta/metamask-beta-ui.spec.js b/test/e2e/beta/metamask-beta-ui.spec.js
index efd391003..4f01f5b50 100644
--- a/test/e2e/beta/metamask-beta-ui.spec.js
+++ b/test/e2e/beta/metamask-beta-ui.spec.js
@@ -72,14 +72,20 @@ describe('MetaMask', function () {
})
describe('New UI setup', async function () {
+ let networkSelector
it('switches to first tab', async function () {
const [firstTab] = await driver.getAllWindowHandles()
await driver.switchTo().window(firstTab)
await delay(regularDelayMs)
+ try {
+ networkSelector = await findElement(driver, By.css('#network_component'))
+ } catch (e) {
+ await loadExtension(driver, extensionId)
+ }
+ await delay(regularDelayMs)
})
it('use the local network', async function () {
- const networkSelector = await findElement(driver, By.css('#network_component'))
await networkSelector.click()
await delay(regularDelayMs)
@@ -177,9 +183,7 @@ describe('MetaMask', function () {
await delay(regularDelayMs)
})
- it('can retype the seed phrase', async () => {
- const words = seedPhrase.split(' ')
-
+ async function retypeSeedPhrase (words) {
const word0 = await findElement(driver, By.xpath(`//button[contains(text(), '${words[0]}')]`))
await word0.click()
await delay(tinyDelayMs)
@@ -224,9 +228,20 @@ describe('MetaMask', function () {
await word10.click()
await delay(tinyDelayMs)
- const word11 = await findElement(driver, By.xpath(`//button[contains(text(), '${words[11]}')]`))
- await word11.click()
- await delay(tinyDelayMs)
+ try {
+ const word11 = await findElement(driver, By.xpath(`//button[contains(text(), '${words[11]}')]`), 10000)
+ await word11.click()
+ await delay(tinyDelayMs)
+ } catch (e) {
+ await loadExtension(driver, extensionId)
+ await retypeSeedPhrase
+ }
+ }
+
+ it('can retype the seed phrase', async () => {
+ const words = seedPhrase.split(' ')
+
+ await retypeSeedPhrase(words)
const confirm = await findElement(driver, By.xpath(`//button[contains(text(), 'Confirm')]`))
await confirm.click()