Skip to content

Commit e5b17fa

Browse files
committed
fix: should not add to capabilities if corresponding browser is unchecked on creation
1 parent ccbcc0d commit e5b17fa

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

packages/@vue/cli-plugin-e2e-webdriverio/generator/template/wdio.local.conf.js

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,24 @@ exports.config = {
99
* config for local testing
1010
*/
1111
maxInstances: 1,
12-
services: ['chromedriver', 'geckodriver'],
13-
capabilities: [{
14-
browserName: 'chrome',
15-
acceptInsecureCerts: true,
16-
'goog:chromeOptions': {
17-
args: process.argv.includes('--headless')
18-
? ['--headless', '--disable-gpu']
19-
: []
12+
services: [<%- options.webdrivers.includes('chrome') ?(options.webdrivers.length > 1 ? `'chromedriver', ` : `'chromedriver'`) : '' %><%- options.webdrivers.includes('firefox') ? `'geckodriver'` : ''%>],
13+
capabilities: [
14+
<%_ if (options.webdrivers.includes('chrome')) { _%>
15+
{
16+
browserName: 'chrome',
17+
acceptInsecureCerts: true,
18+
'goog:chromeOptions': {
19+
args: process.argv.includes('--headless')
20+
? ['--headless', '--disable-gpu']
21+
: []
22+
}
23+
},
24+
<%_ } _%>
25+
<%_ if (options.webdrivers.includes('firefox')) { _%>
26+
{
27+
browserName: 'firefox',
28+
acceptInsecureCerts: true
2029
}
21-
}, {
22-
browserName: 'firefox',
23-
acceptInsecureCerts: true
24-
}]
30+
<%_ } _%>
31+
]
2532
}

0 commit comments

Comments
 (0)