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