diff options
Diffstat (limited to 'test/e2e/beta/from-import-beta-ui.spec.js')
-rw-r--r-- | test/e2e/beta/from-import-beta-ui.spec.js | 73 |
1 files changed, 7 insertions, 66 deletions
diff --git a/test/e2e/beta/from-import-beta-ui.spec.js b/test/e2e/beta/from-import-beta-ui.spec.js index 77a61a73e..4273e7e39 100644 --- a/test/e2e/beta/from-import-beta-ui.spec.js +++ b/test/e2e/beta/from-import-beta-ui.spec.js @@ -12,11 +12,9 @@ const { } = require('../func') const { checkBrowserForConsoleErrors, - closeAllWindowHandlesExcept, verboseReportOnFailure, findElement, findElements, - loadExtension, } = require('./helpers') @@ -27,7 +25,6 @@ describe('Using MetaMask with an existing account', function () { const testSeedPhrase = 'phrase upgrade clock rough situate wedding elder clever doctor stamp excess tent' const testAddress = '0xE18035BF8712672935FDB4e5e431b1a0183d2DFC' const testPrivateKey2 = '14abe6f4aab7f9f626fe981c864d0adeb5685f289ac9270c27b8fd790b4235d6' - const tinyDelayMs = 500 const regularDelayMs = 1000 const largeDelayMs = regularDelayMs * 2 @@ -40,7 +37,7 @@ describe('Using MetaMask with an existing account', function () { const extensionPath = path.resolve('dist/chrome') driver = buildChromeWebDriver(extensionPath) extensionId = await getExtensionIdChrome(driver) - await driver.get(`chrome-extension://${extensionId}/popup.html`) + await driver.get(`chrome-extension://${extensionId}/home.html`) await delay(regularDelayMs) break } @@ -50,7 +47,7 @@ describe('Using MetaMask with an existing account', function () { await installWebExt(driver, extensionPath) await delay(regularDelayMs) extensionId = await getExtensionIdFirefox(driver) - await driver.get(`moz-extension://${extensionId}/popup.html`) + await driver.get(`moz-extension://${extensionId}/home.html`) await delay(regularDelayMs) break } @@ -75,69 +72,13 @@ describe('Using MetaMask with an existing account', function () { await driver.quit() }) - describe('New UI setup', async function () { - it('switches to first tab', async function () { - await delay(tinyDelayMs) - const [firstTab] = await driver.getAllWindowHandles() - await driver.switchTo().window(firstTab) - await delay(regularDelayMs) - }) - - it('selects the new UI option', async () => { - try { - const overlay = await findElement(driver, By.css('.full-flex-height')) - await driver.wait(until.stalenessOf(overlay)) - } catch (e) {} - - let button - try { - button = await findElement(driver, By.xpath("//button[contains(text(), 'Try it now')]")) - } catch (e) { - await loadExtension(driver, extensionId) - await delay(largeDelayMs) - button = await findElement(driver, By.xpath("//button[contains(text(), 'Try it now')]")) - } - await button.click() - await delay(regularDelayMs) - - // Close all other tabs - const [tab0, tab1, tab2] = await driver.getAllWindowHandles() - await driver.switchTo().window(tab0) - await delay(tinyDelayMs) - - let selectedUrl = await driver.getCurrentUrl() - await delay(tinyDelayMs) - if (tab0 && selectedUrl.match(/popup.html/)) { - await closeAllWindowHandlesExcept(driver, tab0) - } else if (tab1) { - await driver.switchTo().window(tab1) - selectedUrl = await driver.getCurrentUrl() - await delay(tinyDelayMs) - if (selectedUrl.match(/popup.html/)) { - await closeAllWindowHandlesExcept(driver, tab1) - } else if (tab2) { - await driver.switchTo().window(tab2) - selectedUrl = await driver.getCurrentUrl() - selectedUrl.match(/popup.html/) && await closeAllWindowHandlesExcept(driver, tab2) - } - } else { - throw new Error('popup.html not found') - } - await delay(regularDelayMs) - const [appTab] = await driver.getAllWindowHandles() - await driver.switchTo().window(appTab) - await delay(tinyDelayMs) - - await loadExtension(driver, extensionId) - await delay(regularDelayMs) - - const continueBtn = await findElement(driver, By.css('.welcome-screen__button')) - await continueBtn.click() - await delay(regularDelayMs) + describe('First time flow starting from an existing seed phrase', () => { + it('clicks the continue button on the welcome screen', async () => { + const welcomeScreenBtn = await findElement(driver, By.css('.welcome-screen__button')) + welcomeScreenBtn.click() + await delay(largeDelayMs) }) - }) - describe('First time flow starting from an existing seed phrase', () => { it('imports a seed phrase', async () => { const [seedPhrase] = await findElements(driver, By.xpath(`//a[contains(text(), 'Import with seed phrase')]`)) await seedPhrase.click() |