提交 74eacb1b 编写于 作者: Q q4speed

增加导出接口测试配置标识和版本。

上级 ec44a1d3
...@@ -205,7 +205,7 @@ ...@@ -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 { ...@@ -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 { ...@@ -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()];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册