From 880454118de296f1f49a2d6dfd5ecccfc2b043e6 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Tue, 29 Mar 2022 16:44:35 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E8=84=9A=E6=9C=AC=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=89=8D=E5=90=8E=E7=BD=AE=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1011769 --user=赵勇 [接口测试]github#12052自定义脚本上的断言没了 https://www.tapd.cn/55049933/s/1127302 --- .../scenario/component/Jsr233Processor.vue | 145 +++++++++++++++++- 1 file changed, 141 insertions(+), 4 deletions(-) diff --git a/frontend/src/business/components/api/automation/scenario/component/Jsr233Processor.vue b/frontend/src/business/components/api/automation/scenario/component/Jsr233Processor.vue index fe285fc558..b24f67f5bb 100644 --- a/frontend/src/business/components/api/automation/scenario/component/Jsr233Processor.vue +++ b/frontend/src/business/components/api/automation/scenario/component/Jsr233Processor.vue @@ -12,8 +12,72 @@ :background-color="backgroundColor" :if-from-variable-advance="ifFromVariableAdvance" :title="title" v-loading="loading"> + + +

{{ $t('api_test.definition.request.req_param') }}

+ + + + + + + + + {{ $t('api_test.definition.request.pre_operation') }} +
+
{{ request.preSize }}
+
+
+ +
+ + + {{ $t('api_test.definition.request.post_operation') }} +
+
{{ request.postSize }}
+
+
+ +
+ + + {{ $t('api_test.definition.request.assertions_rule') }} +
+
{{ request.ruleSize }}
+
+
+ +
+
+
- + + import( "@/business/components/api/definition/components/step/JmxStep") + }, props: { request: {}, message: String, @@ -84,7 +157,7 @@ export default { type: Boolean, default: true, }, - protocol:String, + protocol: String, isReadOnly: { type: Boolean, default: @@ -107,19 +180,59 @@ export default { default: false, }, }, + created() { + if (this.request && this.request.type === 'JSR223Processor' && this.request.hashTree) { + this.initStepSize(this.request.hashTree); + this.historicalDataProcessing(this.request.hashTree); + } + }, watch: { message() { this.forStatus(); this.reload(); }, + 'request.hashTree': { + handler(v) { + this.initStepSize(this.request.hashTree); + }, + deep: true + } }, data() { return { loading: false, - reqSuccess: true + reqSuccess: true, + response: {}, + activeName: "baseScript" } }, methods: { + historicalDataProcessing(array) { + hisDataProcessing(array, this.request); + }, + initStepSize(array) { + stepCompute(array, this.request); + this.reload(); + }, + + tabClick() { + this.$nextTick(() => { + setTimeout(() => { + this.filter(this.activeName); + }); + }); + }, + filter(activeName) { + if (activeName === 'preOperate' && this.$refs.preStep) { + this.$refs.preStep.filter(); + } + if (activeName === 'postOperate' && this.$refs.postStep) { + this.$refs.postStep.filter(); + } + if (activeName === 'assertionsRule' && this.$refs.assertionsRule) { + this.$refs.assertionsRule.filter(); + } + }, forStatus() { if (this.jsr223Processor && this.jsr223Processor.result && this.jsr223Processor.result.length > 0) { this.jsr223Processor.result.forEach(item => { @@ -139,6 +252,9 @@ export default { } }) } + if (this.jsr223Processor.requestResult && this.jsr223Processor.requestResult.length > 0) { + this.response = this.jsr223Processor.requestResult[0] + } }, remove() { this.$emit('remove', this.jsr223Processor, this.node); @@ -177,4 +293,25 @@ export default { color: #67C23A; } +.ms-header { + background: #783887; + color: white; + height: 18px; + font-size: xx-small; + border-radius: 50%; +} + +.request-tabs { + margin: 0px 5px 0px; + min-height: 200px; + width: 100%; +} + +.ms-tip { + padding: 3px 5px; + font-size: 16px; + border-radius: 0; + border-left: 4px solid #783887; + margin: 5px 5px 0px 5px; +}