新增执行用例前端及控制层逻辑

This commit is contained in:
liangdaliang
2025-03-06 11:08:33 +08:00
parent b76a6a16e9
commit bc574d12ff
4 changed files with 46 additions and 18 deletions

View File

@@ -44,3 +44,12 @@ export function delCase(id) {
data: {id}
})
}
// 执行用例
export function runCase(id) {
return request({
url: '/test/case/run',
method: 'post',
data: {id}
})
}

View File

@@ -27,7 +27,7 @@
<script>
import FolderPage from "@/components/FolderPage/index.vue";
import {addCase, delCase, listCase} from "@/api/test/case";
import {addCase, delCase, listCase, runCase} from "@/api/test/case";
export default {
name: "Case",
@@ -81,7 +81,11 @@ export default {
});
},
handleRun(id) {
console.log(id)
this.$modal.confirm('是否确认执行用例?').then(function () {
return runCase(id);
}).then(() => {
this.$modal.msgSuccess("执行成功");
});
},
handleRowClick(row) {
this.$tab.openPage(`用例[${row.name}]`, "/case/detail", {id: row.id});