场景clone

This commit is contained in:
q4speed 2020-05-29 18:12:48 +08:00
parent 2a5c5815e2
commit f30c30325e
1 changed files with 6 additions and 3 deletions

View File

@ -136,6 +136,10 @@ export class Scenario extends BaseConfig {
options.requests = options.requests || [new Request()];
return options;
}
clone() {
return new Scenario(this);
}
}
export class Request extends BaseConfig {
@ -394,9 +398,8 @@ class JMXGenerator {
}
addScenarios(testPlan, scenarios) {
scenarios.forEach(options => {
// clone
let scenario = new Scenario(options);
scenarios.forEach(s => {
let scenario = s.clone();
scenario.name = this.replace(scenario.name);
let threadGroup = new ThreadGroup(scenario.name || "");