测试用例执行相关优化
This commit is contained in:
@@ -53,3 +53,13 @@ export function runCase(id) {
|
||||
data: {id}
|
||||
})
|
||||
}
|
||||
|
||||
// 同步执行用例
|
||||
export function runCaseSync(id) {
|
||||
return request({
|
||||
url: '/test/case/runSync',
|
||||
method: 'post',
|
||||
data: {id},
|
||||
timeout: 60000
|
||||
})
|
||||
}
|
||||
|
||||
@@ -178,6 +178,32 @@ export default {
|
||||
let compareName = '${' + name + '}';
|
||||
return this.extract_object.some(obj => obj.value === compareName);
|
||||
},
|
||||
handleTableEdit(e, flag, scope) {
|
||||
if (flag === "assignment") {
|
||||
if (e && this.form.assignment.length === scope.$index + 1) {
|
||||
this.form.assignment.push({
|
||||
key: "",
|
||||
value: ""
|
||||
})
|
||||
}
|
||||
}
|
||||
if (flag === "assertion") {
|
||||
if (e && this.form.assertion.length === scope.$index + 1) {
|
||||
this.form.assertion.push({
|
||||
key: "",
|
||||
value: ""
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
handleDelete(flag, scope) {
|
||||
if (flag === "assignment") {
|
||||
this.form.assignment.splice(scope.$index, 1)
|
||||
}
|
||||
if (flag === "assertion") {
|
||||
this.form.assertion.splice(scope.$index, 1)
|
||||
}
|
||||
},
|
||||
handleLogChange(val) {
|
||||
const selectedItem = this.form.testCaseResultList.find(item => item.title === val);
|
||||
if (selectedItem) {
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<script>
|
||||
import FolderPage from "@/components/FolderPage/index.vue";
|
||||
import Report from "@/views/test/case/report/index.vue";
|
||||
import {addCase, delCase, listCase, runCase} from "@/api/test/case";
|
||||
import {addCase, delCase, listCase, runCaseSync} from "@/api/test/case";
|
||||
|
||||
export default {
|
||||
name: "Case",
|
||||
@@ -89,12 +89,14 @@ export default {
|
||||
});
|
||||
},
|
||||
handleRun(id) {
|
||||
this.loading = true;
|
||||
this.$modal.confirm('是否确认执行用例?').then(function () {
|
||||
return runCase(id);
|
||||
return runCaseSync(id);
|
||||
}).then((res) => {
|
||||
this.$modal.msgSuccess("执行成功");
|
||||
this.caseSID = res.msg
|
||||
this.caseSID = res.data
|
||||
this.open = true;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
handleRowClick(row) {
|
||||
|
||||
Reference in New Issue
Block a user