Skip to content

Commit

Permalink
Merge pull request #4692 from MetaMask/improve-e2e-beta-test-startup
Browse files Browse the repository at this point in the history
Improve checks for closing info page on app installation in e2e beta tests.
  • Loading branch information
whymarrh committed Jul 2, 2018
2 parents b2e64f2 + c5a16af commit c25a4ff
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions test/e2e/beta/metamask-beta-ui.spec.js
Expand Up @@ -100,15 +100,21 @@ describe('MetaMask', function () {
await delay(regularDelayMs)

// Close all other tabs
let [oldUi, infoPage, newUi] = await driver.getAllWindowHandles()
newUi = newUi || infoPage
let [oldUi, tab1, tab2] = await driver.getAllWindowHandles()
await driver.switchTo().window(oldUi)
await driver.close()
if (infoPage !== newUi) {
await driver.switchTo().window(infoPage)

await driver.switchTo().window(tab1)
const tab1Url = await driver.getCurrentUrl()
if (tab1Url.match(/metamask.io/)) {
await driver.switchTo().window(tab1)
await driver.close()
await driver.switchTo().window(tab2)
} else if (tab2) {
await driver.switchTo().window(tab2)
await driver.close()
await driver.switchTo().window(tab1)
}
await driver.switchTo().window(newUi)
await delay(regularDelayMs)

const continueBtn = await findElement(driver, By.css('.welcome-screen__button'))
Expand Down

0 comments on commit c25a4ff

Please sign in to comment.