Skip to content

Commit

Permalink
fixing security bugs (#70)
Browse files Browse the repository at this point in the history
* fixing security bugs + adding a request from a team , changing travis target
  • Loading branch information
dreuxl authored Mar 9, 2020
1 parent 8bb3a38 commit d926183
Show file tree
Hide file tree
Showing 4 changed files with 1,476 additions and 1,196 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
sudo: false
language: node_js
node_js:
- 7
- 6
- 8
- 9
- 10
addons:
sauce_connect: true
env:
Expand All @@ -16,4 +17,3 @@ deploy:
on:
repo: yahoo/protractor-retry
branch: master

29 changes: 18 additions & 11 deletions lib/retry.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,24 @@ function afterLaunch(configRetry) {
protractorCommand.push('--disableChecks');
/* the remaining command arg */
var usedCommandKeys = ['$0', '_', 'test', 'specs', 'retry' , 'suite', 'help', 'version'];
Object.keys(argv).forEach(function(key) {
if (usedCommandKeys.indexOf(key) === -1) {
if(key === 'params') {
Object.keys(argv[key]).forEach(function(param) {
protractorCommand.push('--params.'+param, argv[key][param]);
});
} else {
protractorCommand.push('--'+key, argv[key]);
}
}
});

const keyify = (obj, prefix = '--') =>
Object.keys(obj).forEach(objectKey => {
if (usedCommandKeys.indexOf(objectKey) === -1) {
if(Array.isArray(obj[objectKey]) ) {
Object.keys(obj[objectKey]).forEach(value => {
protractorCommand.push(prefix + objectKey, obj[objectKey][value]);
});
}
else if (typeof obj[objectKey] === 'object' && obj[objectKey] !== null) {
keyify(obj[objectKey], prefix + objectKey + '.');
} else {
protractorCommand.push(prefix + objectKey, obj[objectKey]);
}
}
}, []);

keyify(argv);

if (retryCount <= retry) {
retryLogger(retryCount, fixedSpecList);
Expand Down
Loading

0 comments on commit d926183

Please sign in to comment.