mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Conditionally close info page in beta e2e tests.
This commit is contained in:
parent
3d57352e54
commit
12e7508584
@ -89,18 +89,23 @@ describe('Using MetaMask with an existing account', function () {
|
||||
})
|
||||
|
||||
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 delay(regularDelayMs)
|
||||
|
||||
// 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.close()
|
||||
if (infoPage !== newUi) {
|
||||
await driver.switchTo().window(infoPage)
|
||||
await driver.close()
|
||||
}
|
||||
await driver.switchTo().window(newUi)
|
||||
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 delay(regularDelayMs)
|
||||
})
|
||||
|
@ -93,9 +93,14 @@ describe('MetaMask', function () {
|
||||
await delay(regularDelayMs)
|
||||
|
||||
// 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.close()
|
||||
if (infoPage !== newUi) {
|
||||
await driver.switchTo().window(infoPage)
|
||||
await driver.close()
|
||||
}
|
||||
await driver.switchTo().window(newUi)
|
||||
await delay(regularDelayMs)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user