A Metamask fork with Infura removed and default networks editable
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ciphermask/test/e2e/webdriver/index.js

34 lines
827 B

const { Browser } = require('selenium-webdriver')
const ChromeDriver = require('./chrome')
const FirefoxDriver = require('./firefox')
const buildWebDriver = async function buildWebDriver ({ browser, extensionPath, responsive }) {
switch (browser) {
case Browser.CHROME: {
const { driver, extensionId, extensionUrl } = await ChromeDriver.build({ extensionPath, responsive })
return {
driver,
extensionId,
extensionUrl,
}
}
case Browser.FIREFOX: {
const { driver, extensionId, extensionUrl } = await FirefoxDriver.build({ extensionPath, responsive })
return {
driver,
extensionId,
extensionUrl,
}
}
default: {
throw new Error(`Unrecognized browser: ${browser}`)
}
}
}
module.exports = {
buildWebDriver,
}