Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}, (args, rawArgs) => {
if (args.env && args.env.includes('firefox')) {
try {
require('geckodriver')
} catch (e) {
error(`To run e2e tests in Firefox, you need to install ${chalk.yellow.bold('geckodriver')} first.`)
process.exit(1)
}
}
if (installedBrowsers.chrome) {
const userVersion = installedBrowsers.chrome
const driverVersion = require('chromedriver').version
const userMajor = userVersion.match(/^(\d+)\./)[1]
const driverMajor = driverVersion.match(/^(\d+)\./)[1]
if (userMajor !== driverMajor) {
warn(`Local ${chalk.cyan.bold('Chrome')} version is ${chalk.cyan.bold(userMajor)}, but the installed ${chalk.cyan.bold('chromedriver')} is for version ${chalk.cyan.bold(driverMajor)}.`)
warn(`There may be incompatibilities between them.`)
warn(`Please update your ${chalk.cyan.bold('chromedriver')} dependency to match the ${chalk.cyan.bold('Chrome')} version.`)
}
}
// remove args
;['url', 'mode'].forEach(toRemove => removeArg(rawArgs, toRemove))
// remove flags
;['headless', 'use-selenium', 'parallel'].forEach(toRemove => removeArg(rawArgs, toRemove, 0))
return Promise.all([
startDevServer(args, api),
loadNightwatchConfig(rawArgs, api)