1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 11:22:43 +02:00

fix e2e tests

This commit is contained in:
brunobar79 2018-08-10 13:11:49 -04:00
parent 6f2c4809b6
commit 42834fe8be

View File

@ -363,36 +363,7 @@ describe('Using MetaMask with an existing account', function () {
await connectButtons[0].click()
await delay(regularDelayMs)
const allWindows = await driver.getAllWindowHandles()
switch (process.env.SELENIUM_BROWSER) {
case 'chrome':
assert.equal(allWindows.length, 2)
break
default:
assert.equal(allWindows.length, 1)
}
})
it('should show the "Browser not supported" screen for non Chrome browsers', async () => {
if (process.env.SELENIUM_BROWSER !== 'chrome') {
const title = await findElements(driver, By.xpath(`//h3[contains(text(), 'Your Browser is not supported...')]`))
assert.equal(title.length, 1)
const downloadChromeButtons = await findElements(driver, By.xpath(`//button[contains(text(), 'Download Google Chrome')]`))
assert.equal(downloadChromeButtons.length, 1)
await downloadChromeButtons[0].click()
await delay(regularDelayMs)
const [newUITab, downloadChromeTab] = await driver.getAllWindowHandles()
await driver.switchTo().window(downloadChromeTab)
await delay(regularDelayMs)
const tabUrl = await driver.getCurrentUrl()
assert.equal(tabUrl, 'https://www.google.com/chrome/')
await driver.close()
await delay(regularDelayMs)
await driver.switchTo().window(newUITab)
}
assert.equal(allWindows.length, 2)
})
})
})