增加导出接口测试配置标识和版本。
This commit is contained in:
parent
ec44a1d373
commit
74eacb1bd4
|
@ -205,7 +205,7 @@
|
|||
})
|
||||
break;
|
||||
case "export":
|
||||
downloadFile(this.test.name + ".json", JSON.stringify(this.test.scenarioDefinition));
|
||||
downloadFile(this.test.name + ".json", this.test.export());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -94,6 +94,7 @@ export class BaseConfig {
|
|||
export class Test extends BaseConfig {
|
||||
constructor(options) {
|
||||
super();
|
||||
this.type = "MS API CONFIG";
|
||||
this.version = '1.0.0';
|
||||
this.id = uuid();
|
||||
this.name = undefined;
|
||||
|
@ -104,6 +105,16 @@ export class Test extends BaseConfig {
|
|||
this.sets({scenarioDefinition: Scenario}, options);
|
||||
}
|
||||
|
||||
export() {
|
||||
let obj = {
|
||||
type: this.type,
|
||||
version: this.version,
|
||||
scenarios: this.scenarioDefinition
|
||||
};
|
||||
|
||||
return JSON.stringify(obj);
|
||||
}
|
||||
|
||||
initOptions(options) {
|
||||
options = options || {};
|
||||
options.scenarioDefinition = options.scenarioDefinition || [new Scenario()];
|
||||
|
|
Loading…
Reference in New Issue