e2e:improve stability#8

This commit is contained in:
dennistikhomirov 2018-10-23 16:03:40 -07:00
parent ac8aa781b7
commit e6e76babee
1 changed files with 4 additions and 7 deletions

View File

@ -1809,20 +1809,17 @@ describe('Metamask popup page', async function () {
}
}
async function waitUntilCurrentUrl()
{
async function waitUntilCurrentUrl () {
try {
let title
let counter = 20
do {
await delay(500)
title = await driver.getCurrentUrl()
} while ( (title === '') && (counter-- > 0) )
if ( counter < 1 ) return false
} while ((title === '') && (counter-- > 0))
if (counter < 1) return false
return title
}
catch(err)
{
} catch (err) {
console.log(err)
return false
}