refactor(场景自动化): 调试前检查运行环境
This commit is contained in:
parent
512d2c3170
commit
d59d4b5fca
|
@ -784,16 +784,16 @@
|
||||||
},
|
},
|
||||||
runDebug() {
|
runDebug() {
|
||||||
/*触发执行操作*/
|
/*触发执行操作*/
|
||||||
let sign = this.$refs.envPopover.checkEnv(this.isFullUrl);
|
|
||||||
if (!sign) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$refs['currentScenario'].validate((valid) => {
|
this.$refs['currentScenario'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
Promise.all([
|
let definition = JSON.parse(JSON.stringify(this.currentScenario));
|
||||||
this.editScenario()]).then(val => {
|
definition.hashTree = this.scenarioDefinition;
|
||||||
if (val) {
|
this.getEnv(JSON.stringify(definition)).then(() => {
|
||||||
|
let sign = this.$refs.envPopover.checkEnv(this.isFullUrl);
|
||||||
|
if (!sign) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.editScenario().then(() => {
|
||||||
this.debugData = {
|
this.debugData = {
|
||||||
id: this.currentScenario.id,
|
id: this.currentScenario.id,
|
||||||
name: this.currentScenario.name,
|
name: this.currentScenario.name,
|
||||||
|
@ -806,8 +806,8 @@
|
||||||
hashTree: this.scenarioDefinition
|
hashTree: this.scenarioDefinition
|
||||||
};
|
};
|
||||||
this.reportId = getUUID().substring(0, 8);
|
this.reportId = getUUID().substring(0, 8);
|
||||||
}
|
})
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -976,12 +976,15 @@
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getEnv(definition) {
|
getEnv(definition) {
|
||||||
this.$post("/api/automation/getApiScenarioEnv", {definition: definition}, res => {
|
return new Promise((resolve) => {
|
||||||
if (res.data) {
|
this.$post("/api/automation/getApiScenarioEnv", {definition: definition}, res => {
|
||||||
this.projectIds = new Set(res.data.projectIds);
|
if (res.data) {
|
||||||
this.isFullUrl = res.data.fullUrl;
|
this.projectIds = new Set(res.data.projectIds);
|
||||||
}
|
this.isFullUrl = res.data.fullUrl;
|
||||||
})
|
}
|
||||||
|
resolve();
|
||||||
|
})
|
||||||
|
});
|
||||||
},
|
},
|
||||||
getApiScenario() {
|
getApiScenario() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
|
Loading…
Reference in New Issue