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