mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Improve checks for closing info page on app installation in e2e beta tests.
This commit is contained in:
parent
9f5ee94b69
commit
c5a16af831
@ -100,15 +100,21 @@ describe('MetaMask', function () {
|
|||||||
await delay(regularDelayMs)
|
await delay(regularDelayMs)
|
||||||
|
|
||||||
// Close all other tabs
|
// Close all other tabs
|
||||||
let [oldUi, infoPage, newUi] = await driver.getAllWindowHandles()
|
let [oldUi, tab1, tab2] = 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.switchTo().window(tab1)
|
||||||
|
const tab1Url = await driver.getCurrentUrl()
|
||||||
|
if (tab1Url.match(/metamask.io/)) {
|
||||||
|
await driver.switchTo().window(tab1)
|
||||||
await driver.close()
|
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)
|
await delay(regularDelayMs)
|
||||||
|
|
||||||
const continueBtn = await findElement(driver, By.css('.welcome-screen__button'))
|
const continueBtn = await findElement(driver, By.css('.welcome-screen__button'))
|
||||||
|
Loading…
Reference in New Issue
Block a user