-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(issues 79 82): issues 79 82 (#181)
- Loading branch information
Showing
6 changed files
with
102 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
const get = require('lodash.get'); | ||
|
||
module.exports = { | ||
addDefaultsToTest, | ||
addDefaultsToStep | ||
}; | ||
|
||
function addDefaultsToTest(artilleryTest) { | ||
const scenarios = get(artilleryTest, 'scenarios', []); | ||
for (let scenario of scenarios){ | ||
const flow = get(scenario, 'flow', []); | ||
for (let step of flow){ | ||
addDefaultsToStep(step); | ||
} | ||
} | ||
|
||
const before = get(artilleryTest, 'before.flow', []); | ||
for (let step of before){ | ||
addDefaultsToStep(step); | ||
} | ||
return artilleryTest; | ||
} | ||
|
||
function addDefaultsToStep(step) { | ||
if (step){ | ||
const method = Object.keys(step)[0]; | ||
if (method){ | ||
step[method].url = step[method].url || '/'; | ||
} | ||
} | ||
return step; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters