From 66559b96bc16704c8dd3fa06784349efa5f5fb3e Mon Sep 17 00:00:00 2001 From: xiaoe Date: Tue, 18 Mar 2025 16:10:01 +0800 Subject: [PATCH 1/8] fix --- test-ui/src/views/test/case/report/index.vue | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/test-ui/src/views/test/case/report/index.vue b/test-ui/src/views/test/case/report/index.vue index dd74490..e31ca18 100644 --- a/test-ui/src/views/test/case/report/index.vue +++ b/test-ui/src/views/test/case/report/index.vue @@ -11,15 +11,15 @@ - + - + - + - + @@ -28,12 +28,16 @@
{{item.sqlCommand}}
- - + + + + + + @@ -42,6 +46,8 @@ + +
From e1fe9b3a63198107386e33613340243bc34465e2 Mon Sep 17 00:00:00 2001 From: xiaoe Date: Tue, 18 Mar 2025 16:13:39 +0800 Subject: [PATCH 2/8] fix --- test-ui/src/views/test/case/detail/step.vue | 12 +++++++++++- test-ui/src/views/test/case/index.vue | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/test-ui/src/views/test/case/detail/step.vue b/test-ui/src/views/test/case/detail/step.vue index bd5fbc9..304e98e 100644 --- a/test-ui/src/views/test/case/detail/step.vue +++ b/test-ui/src/views/test/case/detail/step.vue @@ -35,6 +35,11 @@ 提 交 取 消 + +
+ +
+
@@ -48,18 +53,21 @@ import page3 from "./page3.vue" import page4 from "./page4.vue" import {listHttp} from "@/api/test/http"; import {listDatasource} from "@/api/test/database"; +import Report from "@/views/test/case/report/index.vue"; export default { dicts: ['step_type'], - components: {draggable, page1, page2, page3, page4}, + components: {Report, draggable, page1, page2, page3, page4}, data() { return { id: '', loading: false, + open: false, activeName: null, list: [], hosts: [], datasourceList: [], + caseSID: null, }; }, created() { @@ -147,9 +155,11 @@ export default { methods: { handleRun(id) { this.$modal.confirm('是否确认执行用例?').then(function () { + this.open = true; return runCase(id); }).then(() => { this.$modal.msgSuccess("执行成功"); + this.caseSID = res.msg }); }, // 拖拽结束后更新排序值 diff --git a/test-ui/src/views/test/case/index.vue b/test-ui/src/views/test/case/index.vue index 49795e8..0e6828a 100644 --- a/test-ui/src/views/test/case/index.vue +++ b/test-ui/src/views/test/case/index.vue @@ -90,11 +90,11 @@ export default { }, handleRun(id) { this.$modal.confirm('是否确认执行用例?').then(function () { + this.open = true; return runCase(id); }).then((res) => { this.$modal.msgSuccess("执行成功"); this.caseSID = res.msg - this.open = true; }); }, handleRowClick(row) { From a819999ca2b76e2e50a70478acc980d55ec5ab0d Mon Sep 17 00:00:00 2001 From: xiaoe Date: Wed, 19 Mar 2025 09:13:43 +0800 Subject: [PATCH 3/8] fix --- test-ui/src/views/test/case/detail/step.vue | 2 +- test-ui/src/views/test/case/index.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test-ui/src/views/test/case/detail/step.vue b/test-ui/src/views/test/case/detail/step.vue index 304e98e..b1e5718 100644 --- a/test-ui/src/views/test/case/detail/step.vue +++ b/test-ui/src/views/test/case/detail/step.vue @@ -155,11 +155,11 @@ export default { methods: { handleRun(id) { this.$modal.confirm('是否确认执行用例?').then(function () { - this.open = true; return runCase(id); }).then(() => { this.$modal.msgSuccess("执行成功"); this.caseSID = res.msg + this.open = true; }); }, // 拖拽结束后更新排序值 diff --git a/test-ui/src/views/test/case/index.vue b/test-ui/src/views/test/case/index.vue index 0e6828a..49795e8 100644 --- a/test-ui/src/views/test/case/index.vue +++ b/test-ui/src/views/test/case/index.vue @@ -90,11 +90,11 @@ export default { }, handleRun(id) { this.$modal.confirm('是否确认执行用例?').then(function () { - this.open = true; return runCase(id); }).then((res) => { this.$modal.msgSuccess("执行成功"); this.caseSID = res.msg + this.open = true; }); }, handleRowClick(row) { From 57714bbaebd1dee814f8c7a5015006b7ad9a9ec3 Mon Sep 17 00:00:00 2001 From: xiaoe Date: Wed, 19 Mar 2025 09:19:58 +0800 Subject: [PATCH 4/8] fix --- test-ui/src/views/test/case/report/index.vue | 50 ++++++-------------- 1 file changed, 15 insertions(+), 35 deletions(-) diff --git a/test-ui/src/views/test/case/report/index.vue b/test-ui/src/views/test/case/report/index.vue index e31ca18..928eb32 100644 --- a/test-ui/src/views/test/case/report/index.vue +++ b/test-ui/src/views/test/case/report/index.vue @@ -63,55 +63,33 @@ - - - - - - - - - - + + + - - - - - - - - - - + + + - +
{{item.sqlCommand}}
- - + + + + + + @@ -120,6 +98,8 @@ + +
From 8c676dc30a29c3f9e5808d01e704564f9e0f4934 Mon Sep 17 00:00:00 2001 From: xiaoe Date: Wed, 19 Mar 2025 09:21:42 +0800 Subject: [PATCH 5/8] fix --- test-ui/src/views/test/case/report/index.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test-ui/src/views/test/case/report/index.vue b/test-ui/src/views/test/case/report/index.vue index 928eb32..78b36bc 100644 --- a/test-ui/src/views/test/case/report/index.vue +++ b/test-ui/src/views/test/case/report/index.vue @@ -3,9 +3,9 @@ From ad3e95bd7321e9ea64ee7e1820a861998bed0322 Mon Sep 17 00:00:00 2001 From: liangdaliang Date: Wed, 19 Mar 2025 13:09:01 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E7=94=A8=E4=BE=8B=E7=BC=96=E6=8E=92?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../test/controller/TestCaseController.java | 7 ++- test-ui/src/views/test/case/detail/index.vue | 4 +- test-ui/src/views/test/case/detail/page1.vue | 18 ++++--- test-ui/src/views/test/case/detail/page2.vue | 49 +++++++++++++++++-- test-ui/src/views/test/case/detail/step.vue | 19 +++++-- 5 files changed, 81 insertions(+), 16 deletions(-) diff --git a/test-test/src/main/java/com/test/test/controller/TestCaseController.java b/test-test/src/main/java/com/test/test/controller/TestCaseController.java index df7f278..0f3f7fb 100644 --- a/test-test/src/main/java/com/test/test/controller/TestCaseController.java +++ b/test-test/src/main/java/com/test/test/controller/TestCaseController.java @@ -17,6 +17,7 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import java.util.List; +import java.util.concurrent.CompletableFuture; /** * 用例Controller @@ -87,6 +88,10 @@ public class TestCaseController extends BaseController { @PostMapping("/run") public AjaxResult run(@RequestBody IDQO qo) { log.info("执行用例 id:{}, jmeterHomePath:{}", qo.getId(), jmeterHomePath); - return success(testCaseService.executeTestCaseById(qo.getId(), jmeterHomePath)); + // 异步执行任务 + CompletableFuture.runAsync(() -> { + testCaseService.executeTestCaseById(qo.getId(), jmeterHomePath); + }); + return toAjax(true); } } diff --git a/test-ui/src/views/test/case/detail/index.vue b/test-ui/src/views/test/case/detail/index.vue index 00ce270..ca56715 100644 --- a/test-ui/src/views/test/case/detail/index.vue +++ b/test-ui/src/views/test/case/detail/index.vue @@ -6,7 +6,7 @@ - + @@ -96,7 +96,7 @@ export default { }).then(res => { this.$message.success("修改成功"); this.loading = false; - this.$tab.closeOpenPage({path: "/case"}); + // this.$tab.closeOpenPage({path: "/case"}); }) } } diff --git a/test-ui/src/views/test/case/detail/page1.vue b/test-ui/src/views/test/case/detail/page1.vue index 88c5c7f..c22ef36 100644 --- a/test-ui/src/views/test/case/detail/page1.vue +++ b/test-ui/src/views/test/case/detail/page1.vue @@ -99,7 +99,7 @@ @@ -130,9 +130,6 @@ - - - @@ -206,7 +203,7 @@ import {getCaseStepResultLog} from "@/api/test/caseStep"; export default { components: {FolderPage, JsonEditorVue, codemirror}, - dicts: ['http_method', 'http_protocol','extract_type','extract_object','assert_condition'], + dicts: ['http_method', 'http_protocol','extract_type','assert_condition'], props: { form: { type: Object @@ -231,6 +228,16 @@ export default { pageSize: 10, groupId: null, }, + extract_object: [{ + value: '${RESPONSE_BODY}', + label: '${RESPONSE_BODY}' + }, { + value: '${RESPONSE_HEADER}', + label: '${RESPONSE_HEADER}' + }, { + value: '${RESPONSE_CODE}', + label: '${RESPONSE_CODE}' + }], resultLog: { requestHeader: '', requestBody: '', @@ -238,7 +245,6 @@ export default { responseBody: '', sqlResult: '' }, - title: '111111', activeNames: 'requestHeader', activeTabs: 'requestHeader', editorOptions: { diff --git a/test-ui/src/views/test/case/detail/page2.vue b/test-ui/src/views/test/case/detail/page2.vue index 4448fe9..c234cd0 100644 --- a/test-ui/src/views/test/case/detail/page2.vue +++ b/test-ui/src/views/test/case/detail/page2.vue @@ -20,12 +20,18 @@ @@ -39,6 +45,15 @@ + + + + + + + + + @@ -54,7 +69,10 @@ @@ -79,9 +97,11 @@ import "codemirror/lib/codemirror.css"; import "codemirror/mode/sql/sql"; // 语言模式 import "codemirror/theme/dracula.css"; import "codemirror/addon/display/autorefresh"; +import {getCaseStepResultLog} from "@/api/test/caseStep"; export default { components: { codemirror }, + dicts: ['extract_type','assert_condition'], props: { form: { type: Object @@ -93,6 +113,19 @@ export default { data() { return { activeName: "sql", + extract_object: [{ + value: '${RESULT_DATA}', + label: '${RESULT_DATA}' + }], + resultLog: { + requestHeader: '', + requestBody: '', + responseHeader: '', + responseBody: '', + sqlResult: '' + }, + activeNames: 'sqlResult', + activeTabs: 'sqlResult', editorOptions: { autoRefresh: true, mode: "sql", // 代码语言 @@ -102,6 +135,16 @@ export default { } } }, + methods: { + handleLogChange(val) { + const selectedItem = this.form.testCaseResultList.find(item => item.title === val); + if (selectedItem) { + getCaseStepResultLog(selectedItem.id).then(res => { + this.resultLog = res.data; + }); + } + }, + } } diff --git a/test-ui/src/views/test/case/detail/step.vue b/test-ui/src/views/test/case/detail/step.vue index b1e5718..def65c4 100644 --- a/test-ui/src/views/test/case/detail/step.vue +++ b/test-ui/src/views/test/case/detail/step.vue @@ -1,14 +1,18 @@