Skip to content

Commit

Permalink
transform to valid browser caps
Browse files Browse the repository at this point in the history
refs #2
  • Loading branch information
christian-bromann committed Apr 14, 2021
1 parent 69aab64 commit e10523e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
14 changes: 14 additions & 0 deletions protractor/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,20 @@ function parseCapabilities (caps) {
)
} else if (name === 'seleniumAddress') {
parsedCaps.push(...parseSeleniumAddress.call(this, cap.value.value))
} else if (name === 'chromeOptions') {
parsedCaps.push(
this.objectProperty(
this.literal('goog:chromeOptions'),
cap.value
)
)
} else if (name === 'firefoxOptions') {
parsedCaps.push(
this.objectProperty(
this.literal('moz:firefoxOptions'),
cap.value
)
)
} else if (!IGNORED_CAPABILITIES.includes(name)) {
parsedCaps.push(cap)
}
Expand Down
8 changes: 7 additions & 1 deletion test/__fixtures__/protractor/source/conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ exports.config = {
name: 'foobar',
seleniumAddress: 'http://localhost:4444/wd/hub',
maxInstances: 123,
shardTestFiles: true
shardTestFiles: true,
chromeOptions: {
args: ['foobar']
},
firefoxOptions: {
args: ['foobar']
}
},
multiCapabilities: [{
'browserName': 'chrome',
Expand Down
10 changes: 9 additions & 1 deletion test/__fixtures__/protractor/transformed/conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ exports.config = {
hostname: "localhost",
port: 4444,
path: "/wd/hub",
maxInstances: 123
maxInstances: 123,

"goog:chromeOptions": {
args: ['foobar']
},

"moz:firefoxOptions": {
args: ['foobar']
}
}],

capabilities: [{
Expand Down

0 comments on commit e10523e

Please sign in to comment.