Conditionally close info page in beta e2e tests.

feature/default_network_editable
Dan 7 years ago
parent 3d57352e54
commit 12e7508584
  1. 11
      test/e2e/beta/from-import-beta-ui.spec.js
  2. 7
      test/e2e/beta/metamask-beta-ui.spec.js

@ -89,18 +89,23 @@ describe('Using MetaMask with an existing account', function () {
}) })
it('selects the new UI option', async () => { it('selects the new UI option', async () => {
const button = await driver.findElement(By.xpath("//p[contains(text(), 'Try Beta Version')]")) const button = await findElement(driver, By.xpath("//p[contains(text(), 'Try Beta Version')]"))
await button.click() await button.click()
await delay(regularDelayMs) await delay(regularDelayMs)
// Close all other tabs // Close all other tabs
const [oldUi, newUi] = await driver.getAllWindowHandles() let [oldUi, infoPage, newUi] = await driver.getAllWindowHandles()
newUi = newUi || infoPage
await driver.switchTo().window(oldUi) await driver.switchTo().window(oldUi)
await driver.close() await driver.close()
if (infoPage !== newUi) {
await driver.switchTo().window(infoPage)
await driver.close()
}
await driver.switchTo().window(newUi) await driver.switchTo().window(newUi)
await delay(regularDelayMs) await delay(regularDelayMs)
const [continueBtn] = await driver.findElements(By.css('.welcome-screen__button')) const continueBtn = await findElement(driver, By.css('.welcome-screen__button'))
await continueBtn.click() await continueBtn.click()
await delay(regularDelayMs) await delay(regularDelayMs)
}) })

@ -93,9 +93,14 @@ describe('MetaMask', function () {
await delay(regularDelayMs) await delay(regularDelayMs)
// Close all other tabs // Close all other tabs
const [oldUi, newUi] = await driver.getAllWindowHandles() let [oldUi, infoPage, newUi] = await driver.getAllWindowHandles()
newUi = newUi || infoPage
await driver.switchTo().window(oldUi) await driver.switchTo().window(oldUi)
await driver.close() await driver.close()
if (infoPage !== newUi) {
await driver.switchTo().window(infoPage)
await driver.close()
}
await driver.switchTo().window(newUi) await driver.switchTo().window(newUi)
await delay(regularDelayMs) await delay(regularDelayMs)

Loading…
Cancel
Save