diff options
test - e2e - remove usage of extensionId from tests
-rw-r--r-- | test/e2e/beta/from-import-beta-ui.spec.js | 13 | ||||
-rw-r--r-- | test/e2e/beta/helpers.js | 14 | ||||
-rw-r--r-- | test/e2e/beta/metamask-beta-ui.spec.js | 11 | ||||
-rw-r--r-- | test/e2e/metamask.spec.js | 2 |
4 files changed, 12 insertions, 28 deletions
diff --git a/test/e2e/beta/from-import-beta-ui.spec.js b/test/e2e/beta/from-import-beta-ui.spec.js index d6e976dea..cd7d90e95 100644 --- a/test/e2e/beta/from-import-beta-ui.spec.js +++ b/test/e2e/beta/from-import-beta-ui.spec.js @@ -9,17 +9,16 @@ const { verboseReportOnFailure, } = require('../func') const { - checkBrowserForConsoleErrors, - loadExtension, findElement, findElements, + checkBrowserForConsoleErrors, } = require('./helpers') describe('Using MetaMask with an existing account', function () { const browser = process.env.SELENIUM_BROWSER - let extensionId let driver + let extensionUri let tokenAddress const testSeedPhrase = 'phrase upgrade clock rough situate wedding elder clever doctor stamp excess tent' @@ -273,7 +272,7 @@ describe('Using MetaMask with an existing account', function () { await delay(regularDelayMs) await driver.switchTo().window(extension) - await loadExtension(driver, extensionId) + await driver.get(extensionUri) await delay(regularDelayMs) const confirmButton = await findElement(driver, By.xpath(`//button[contains(text(), 'Confirm')]`), 14000) @@ -286,7 +285,7 @@ describe('Using MetaMask with an existing account', function () { await delay(regularDelayMs) await driver.switchTo().window(extension) await delay(regularDelayMs) - await loadExtension(driver, extensionId) + await driver.get(extensionUri) await delay(regularDelayMs) }) }) @@ -348,7 +347,7 @@ describe('Using MetaMask with an existing account', function () { await delay(regularDelayMs) await driver.switchTo().window(extension) - await loadExtension(driver, extensionId) + await driver.get(extensionUri) await delay(regularDelayMs) const confirmButton = await findElement(driver, By.xpath(`//button[contains(text(), 'Confirm')]`)) @@ -361,7 +360,7 @@ describe('Using MetaMask with an existing account', function () { tokenAddress = await tokenContactAddress.getText() await driver.close() await driver.switchTo().window(extension) - await loadExtension(driver, extensionId) + await driver.get(extensionUri) await delay(regularDelayMs) }) diff --git a/test/e2e/beta/helpers.js b/test/e2e/beta/helpers.js index 5951ea79b..eaf2e0ade 100644 --- a/test/e2e/beta/helpers.js +++ b/test/e2e/beta/helpers.js @@ -2,24 +2,10 @@ const { until } = require('selenium-webdriver') module.exports = { checkBrowserForConsoleErrors, - loadExtension, findElement, findElements, } -async function loadExtension (driver, extensionId) { - switch (process.env.SELENIUM_BROWSER) { - case 'chrome': { - await driver.get(`chrome-extension://${extensionId}/home.html`) - break - } - case 'firefox': { - await driver.get(`moz-extension://${extensionId}/home.html`) - break - } - } -} - async function checkBrowserForConsoleErrors (driver) { const ignoredLogTypes = ['WARNING'] const ignoredErrorMessages = [ diff --git a/test/e2e/beta/metamask-beta-ui.spec.js b/test/e2e/beta/metamask-beta-ui.spec.js index 3cc9f6a2a..efd116c97 100644 --- a/test/e2e/beta/metamask-beta-ui.spec.js +++ b/test/e2e/beta/metamask-beta-ui.spec.js @@ -12,13 +12,12 @@ const { findElement, findElements, checkBrowserForConsoleErrors, - loadExtension, } = require('./helpers') describe('MetaMask', function () { const browser = process.env.SELENIUM_BROWSER - let extensionId let driver + let extensionUri let tokenAddress const testSeedPhrase = 'phrase upgrade clock rough situate wedding elder clever doctor stamp excess tent' @@ -361,7 +360,7 @@ describe('MetaMask', function () { await delay(regularDelayMs) await driver.switchTo().window(extension) - await loadExtension(driver, extensionId) + await driver.get(extensionUri) await delay(regularDelayMs) const confirmButton = await findElement(driver, By.xpath(`//button[contains(text(), 'Confirm')]`), 14000) @@ -374,7 +373,7 @@ describe('MetaMask', function () { await delay(regularDelayMs) await driver.switchTo().window(extension) await delay(regularDelayMs) - await loadExtension(driver, extensionId) + await driver.get(extensionUri) await delay(regularDelayMs) }) }) @@ -437,7 +436,7 @@ describe('MetaMask', function () { await delay(regularDelayMs) await driver.switchTo().window(extension) - await loadExtension(driver, extensionId) + await driver.get(extensionUri) await delay(regularDelayMs) const confirmButton = await findElement(driver, By.xpath(`//button[contains(text(), 'Confirm')]`)) @@ -450,7 +449,7 @@ describe('MetaMask', function () { tokenAddress = await tokenContactAddress.getText() await driver.close() await driver.switchTo().window(extension) - await loadExtension(driver, extensionId) + await driver.get(extensionUri) await delay(regularDelayMs) }) diff --git a/test/e2e/metamask.spec.js b/test/e2e/metamask.spec.js index 6243bf8d6..30b077cde 100644 --- a/test/e2e/metamask.spec.js +++ b/test/e2e/metamask.spec.js @@ -8,7 +8,7 @@ const { delay, createModifiedTestBuild, setupBrowserAndExtension, verboseReportO describe('Metamask popup page', function () { const browser = process.env.SELENIUM_BROWSER - let driver, accountAddress, tokenAddress, extensionId, extensionUri + let driver, accountAddress, tokenAddress, extensionUri this.timeout(0) |