场景clone
This commit is contained in:
parent
2a5c5815e2
commit
f30c30325e
|
@ -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 || "");
|
||||||
|
|
Loading…
Reference in New Issue