Skip to content

fix(nightwatch): compat with legacy presets without webdrivers field #5601

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 22, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/@vue/cli-plugin-e2e-nightwatch/generator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ module.exports = (api, { webdrivers }) => {
// Use devDependencies to store latest version number so as to automate update
const pluginDeps = require('../package.json').devDependencies

// In some legacy presets, they may forget to add a `webdrivers` field
// (which works fine before PR #5528).
// So we should add both drivers by default in that circumstance.
if (typeof webdrivers === 'undefined') {
webdrivers = ['firefox', 'chrome']
}

if (webdrivers && webdrivers.includes('firefox')) {
devDependencies.geckodriver = pluginDeps.geckodriver
}
Expand Down