新增调试按钮以及http结果记录请求头和请求体参数

This commit is contained in:
liangdaliang
2025-03-11 18:11:03 +08:00
parent a1171c0a4a
commit d3d0090465
5 changed files with 42 additions and 6 deletions

View File

@@ -3,6 +3,7 @@
<div style="margin-bottom:20px;">
<el-dropdown trigger="click" @command="handleAdd">
<el-button type="primary" plain icon="el-icon-plus" size="mini">添加步骤</el-button>
<el-button type="primary" plain icon="el-icon-caret-right" size="mini" @click="handleRun(id)">调试</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-for="dict in dict.type.step_type" :command="dict.value" :key="dict.value">{{ dict.label }}</el-dropdown-item>
</el-dropdown-menu>
@@ -39,6 +40,7 @@
<script>
import draggable from "vuedraggable";
import {runCase} from "@/api/test/case";
import {listCaseStep, updateCaseStep} from "@/api/test/caseStep";
import page1 from "./page1.vue"
import page2 from "./page2.vue"
@@ -52,6 +54,7 @@ export default {
components: {draggable, page1, page2, page3, page4},
data() {
return {
id: '',
loading: false,
activeName: null,
list: [],
@@ -70,6 +73,7 @@ export default {
listCaseStep({caseId: this.$route.query.id}).then(res => {
this.list = [];
res.data.forEach(item => {
this.id = item.caseId;
let p = {
...item,
assertion: item.assertion ? JSON.parse(item.assertion) : [],
@@ -104,6 +108,13 @@ export default {
},
methods: {
handleRun(id) {
this.$modal.confirm('是否确认执行用例?').then(function () {
return runCase(id);
}).then(() => {
this.$modal.msgSuccess("执行成功");
});
},
// 拖拽结束后更新排序值
onDragEnd() {
this.updateSortValues();