diff --git a/backend/src/main/java/io/metersphere/api/jmeter/APIBackendListenerClient.java b/backend/src/main/java/io/metersphere/api/jmeter/APIBackendListenerClient.java index 85fb04dd4d..53da366124 100644 --- a/backend/src/main/java/io/metersphere/api/jmeter/APIBackendListenerClient.java +++ b/backend/src/main/java/io/metersphere/api/jmeter/APIBackendListenerClient.java @@ -137,6 +137,7 @@ public class APIBackendListenerClient extends AbstractBackendListenerClient impl requestResult.setBody(result.getSamplerData()); requestResult.setHeaders(result.getRequestHeaders()); requestResult.setRequestSize(result.getSentBytes()); + requestResult.setStartTime(result.getStartTime()); requestResult.setTotalAssertions(result.getAssertionResults().length); requestResult.setSuccess(result.isSuccessful()); requestResult.setError(result.getErrorCount()); diff --git a/backend/src/main/java/io/metersphere/api/jmeter/RequestResult.java b/backend/src/main/java/io/metersphere/api/jmeter/RequestResult.java index ed756d9f0a..d3c20cac4e 100644 --- a/backend/src/main/java/io/metersphere/api/jmeter/RequestResult.java +++ b/backend/src/main/java/io/metersphere/api/jmeter/RequestResult.java @@ -16,6 +16,8 @@ public class RequestResult { private long requestSize; + private long startTime; + private int error; private boolean success; diff --git a/backend/src/main/java/io/metersphere/job/sechedule/ApiTestJob.java b/backend/src/main/java/io/metersphere/job/sechedule/ApiTestJob.java index bb855d77e7..ae0c872574 100644 --- a/backend/src/main/java/io/metersphere/job/sechedule/ApiTestJob.java +++ b/backend/src/main/java/io/metersphere/job/sechedule/ApiTestJob.java @@ -14,7 +14,6 @@ import org.quartz.TriggerKey; public class ApiTestJob extends MsScheduleJob { private APITestService apiTestService; - private MailService mailService; public ApiTestJob() { apiTestService = (APITestService) CommonBeanFactory.getBean(APITestService.class); } diff --git a/backend/src/main/java/io/metersphere/xpack b/backend/src/main/java/io/metersphere/xpack index c2dacf960c..cf6b065263 160000 --- a/backend/src/main/java/io/metersphere/xpack +++ b/backend/src/main/java/io/metersphere/xpack @@ -1 +1 @@ -Subproject commit c2dacf960cdb1ed35664bdd3432120b1203b73d8 +Subproject commit cf6b06526324326a563d933e07118fac014a63b4 diff --git a/frontend/src/business/components/api/head/ApiHeaderMenus.vue b/frontend/src/business/components/api/head/ApiHeaderMenus.vue index 9748c38f50..1bc88dc6b9 100644 --- a/frontend/src/business/components/api/head/ApiHeaderMenus.vue +++ b/frontend/src/business/components/api/head/ApiHeaderMenus.vue @@ -90,6 +90,10 @@ export default { methods: { registerEvents() { ApiEvent.$on(LIST_CHANGE, () => { + // todo 这里偶尔会有 refs 为空的情况 + if (!this.$refs.projectRecent) { + return; + } this.$refs.projectRecent.recent(); this.$refs.testRecent.recent(); this.$refs.reportRecent.recent(); diff --git a/frontend/src/business/components/api/report/ApiReportView.vue b/frontend/src/business/components/api/report/ApiReportView.vue index ce2c8524d8..eb94c2e9a3 100644 --- a/frontend/src/business/components/api/report/ApiReportView.vue +++ b/frontend/src/business/components/api/report/ApiReportView.vue @@ -1,232 +1,25 @@ - diff --git a/frontend/src/business/components/api/report/ApiReportViewDetail.vue b/frontend/src/business/components/api/report/ApiReportViewDetail.vue new file mode 100644 index 0000000000..8b29bf8f33 --- /dev/null +++ b/frontend/src/business/components/api/report/ApiReportViewDetail.vue @@ -0,0 +1,224 @@ + + + + + + diff --git a/frontend/src/business/components/api/report/ApiReportViewHeader.vue b/frontend/src/business/components/api/report/ApiReportViewHeader.vue new file mode 100644 index 0000000000..faddf00722 --- /dev/null +++ b/frontend/src/business/components/api/report/ApiReportViewHeader.vue @@ -0,0 +1,52 @@ + + + + + diff --git a/frontend/src/business/components/api/report/components/RequestResultTail.vue b/frontend/src/business/components/api/report/components/RequestResultTail.vue index cd32477807..097c60c008 100644 --- a/frontend/src/business/components/api/report/components/RequestResultTail.vue +++ b/frontend/src/business/components/api/report/components/RequestResultTail.vue @@ -2,10 +2,13 @@
- + {{scenarioName}} + + {{$t('api_report.start_time')}} + {{$t('api_report.response_time')}} @@ -20,17 +23,20 @@ - +
{{request.method}}
- +
{{request.name}}
{{request.url}}
+ + {{request.startTime | timestampFormatDate(true) }} +
{{request.responseResult.responseTime}} diff --git a/frontend/src/business/components/api/test/ApiTestConfig.vue b/frontend/src/business/components/api/test/ApiTestConfig.vue index d0284773cb..e76812463e 100644 --- a/frontend/src/business/components/api/test/ApiTestConfig.vue +++ b/frontend/src/business/components/api/test/ApiTestConfig.vue @@ -14,9 +14,13 @@ - - {{ $t('commons.save') }} - + + + {{ $t('commons.save') }} + + @@ -67,7 +71,7 @@ diff --git a/frontend/src/business/components/api/test/components/ApiScenarioConfig.vue b/frontend/src/business/components/api/test/components/ApiScenarioConfig.vue index 08dd8f9f49..ada1e09293 100644 --- a/frontend/src/business/components/api/test/components/ApiScenarioConfig.vue +++ b/frontend/src/business/components/api/test/components/ApiScenarioConfig.vue @@ -147,6 +147,7 @@ export default { deleteScenario(index) { this.scenarios.splice(index, 1); if (this.scenarios.length === 0) { + this.type = this.types.CREATE; this.createScenario(); this.select(this.scenarios[0]); } diff --git a/frontend/src/business/components/api/test/components/processor/Jsr233Processor.vue b/frontend/src/business/components/api/test/components/processor/Jsr233Processor.vue index 08d97579e0..3991e120fc 100644 --- a/frontend/src/business/components/api/test/components/processor/Jsr233Processor.vue +++ b/frontend/src/business/components/api/test/components/processor/Jsr233Processor.vue @@ -34,7 +34,7 @@ codeTemplates: [ { title: this.$t('api_test.request.processor.code_template_get_variable'), - value: 'vars.get("variable_name");', + value: 'vars.get("variable_name")', }, { title: this.$t('api_test.request.processor.code_template_set_variable'), @@ -42,17 +42,17 @@ }, { title: this.$t('api_test.request.processor.code_template_get_response_header'), - value: 'prev.getResponseHeaders();', + value: 'prev.getResponseHeaders()', disabled: this.isPreProcessor }, { title: this.$t('api_test.request.processor.code_template_get_response_code'), - value: 'prev.getResponseCode();', + value: 'prev.getResponseCode()', disabled: this.isPreProcessor }, { title: this.$t('api_test.request.processor.code_template_get_response_result'), - value: 'prev.getResponseDataAsString();', + value: 'prev.getResponseDataAsString()', disabled: this.isPreProcessor } ], @@ -93,6 +93,9 @@ this.jsr223Processor.script = ""; } this.jsr223Processor.script += template.value; + if (this.jsr223Processor.language === 'beanshell') { + this.jsr223Processor.script += ';'; + } this.reload(); }, reload() { diff --git a/frontend/src/business/components/api/test/components/request/ApiSqlRequestForm.vue b/frontend/src/business/components/api/test/components/request/ApiSqlRequestForm.vue index 3ff5c096d4..92212cfffa 100644 --- a/frontend/src/business/components/api/test/components/request/ApiSqlRequestForm.vue +++ b/frontend/src/business/components/api/test/components/request/ApiSqlRequestForm.vue @@ -5,11 +5,24 @@ - - - - - +
+ + + + + + + + + + + + + + +
@@ -25,17 +38,6 @@ - - - - - - - - - {{$t('api_test.request.debug')}} @@ -147,4 +149,12 @@ height: calc(100vh - 570px); } + .one-row .el-form-item { + display: inline-block; + } + + .one-row .el-form-item:nth-child(2) { + margin-left: 60px; + } + diff --git a/frontend/src/business/components/performance/head/PerformanceHeaderMenus.vue b/frontend/src/business/components/performance/head/PerformanceHeaderMenus.vue index 4590a5638a..5d56c24562 100644 --- a/frontend/src/business/components/performance/head/PerformanceHeaderMenus.vue +++ b/frontend/src/business/components/performance/head/PerformanceHeaderMenus.vue @@ -98,6 +98,10 @@ export default { methods: { registerEvents() { PerformanceEvent.$on(LIST_CHANGE, () => { + // todo 这里偶尔会有 refs 为空的情况 + if (!this.$refs.projectRecent) { + return; + } this.$refs.projectRecent.recent(); this.$refs.testRecent.recent(); this.$refs.reportRecent.recent(); diff --git a/frontend/src/business/components/track/head/TrackHeaderMenus.vue b/frontend/src/business/components/track/head/TrackHeaderMenus.vue index 341bb490bd..fe47829171 100644 --- a/frontend/src/business/components/track/head/TrackHeaderMenus.vue +++ b/frontend/src/business/components/track/head/TrackHeaderMenus.vue @@ -150,6 +150,10 @@ export default { }, registerEvents() { TrackEvent.$on(LIST_CHANGE, () => { + // todo 这里偶尔会有 refs 为空的情况 + if (!this.$refs.projectRecent) { + return; + } this.$refs.projectRecent.recent(); this.$refs.planRecent.recent(); this.$refs.caseRecent.recent(); diff --git a/frontend/src/business/components/track/plan/view/comonents/TestCaseReportExport.vue b/frontend/src/business/components/track/plan/view/comonents/TestCaseReportExport.vue index 6f0090c645..b2b88dac63 100644 --- a/frontend/src/business/components/track/plan/view/comonents/TestCaseReportExport.vue +++ b/frontend/src/business/components/track/plan/view/comonents/TestCaseReportExport.vue @@ -1,5 +1,5 @@ +
diff --git a/frontend/src/business/components/track/plan/view/comonents/test/ApiTestDetail.vue b/frontend/src/business/components/track/plan/view/comonents/test/ApiTestDetail.vue index 10f7b30e93..73dbe99f39 100644 --- a/frontend/src/business/components/track/plan/view/comonents/test/ApiTestDetail.vue +++ b/frontend/src/business/components/track/plan/view/comonents/test/ApiTestDetail.vue @@ -16,7 +16,7 @@
- + diff --git a/frontend/src/business/components/track/plan/view/comonents/test/ApiTestResult.vue b/frontend/src/business/components/track/plan/view/comonents/test/ApiTestResult.vue index a9ea83c46a..d5ac28aa8a 100644 --- a/frontend/src/business/components/track/plan/view/comonents/test/ApiTestResult.vue +++ b/frontend/src/business/components/track/plan/view/comonents/test/ApiTestResult.vue @@ -1,136 +1,22 @@ diff --git a/frontend/src/common/js/filter.js b/frontend/src/common/js/filter.js index c0d5cf8bbf..9de3b91a8a 100644 --- a/frontend/src/common/js/filter.js +++ b/frontend/src/common/js/filter.js @@ -10,7 +10,7 @@ const options = function (value, array) { return value; }; -const timestampFormatDate = function (timestamp) { +const timestampFormatDate = function (timestamp, showMs) { if (!timestamp) { return timestamp } @@ -34,7 +34,14 @@ const timestampFormatDate = function (timestamp) { let s = date.getSeconds(); s = s < 10 ? ('0' + s) : s; - return y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s + let format = y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s; + + if (showMs === true) { + let ms = date.getMilliseconds(); + format += ':' + ms + } + + return format }; const filters = { diff --git a/frontend/src/common/js/utils.js b/frontend/src/common/js/utils.js index 65f80b0a50..2c1c631826 100644 --- a/frontend/src/common/js/utils.js +++ b/frontend/src/common/js/utils.js @@ -255,7 +255,7 @@ export function exportPdf(name, canvasList) { } } - pdf.save(name + '.pdf'); + pdf.save(name.replace(" ", "_") + '.pdf'); } diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index 19bd9f5b56..790533e1f2 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -598,6 +598,7 @@ export default { scenario_name: "Scenario name", response_time: "Response time(ms)", latency: "Latency", + start_time: "Start Time", request_size: "Request Size", response_size: "Response Size", response_code: "Response Code", diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index d5c99d81b4..b42ff6f175 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -598,6 +598,7 @@ export default { delete_confirm: '确认删除报告: ', delete_batch_confirm: '确认批量删除报告', scenario_name: "场景名称", + start_time: "开始时间", response_time: "响应时间(ms)", latency: "网络延迟", request_size: "请求大小", diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index 3210781c7c..ef3ad4e77f 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -598,6 +598,7 @@ export default { delete_confirm: '確認刪除報告: ', delete_batch_confirm: '確認批量刪除報告', scenario_name: "場景名稱", + start_time: "開始時間", response_time: "響應時間(ms)", latency: "網絡延遲", request_size: "請求大小",