diff --git a/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/assertions/document/MsAssertionDocument.java b/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/assertions/document/MsAssertionDocument.java index f2b05e4a47..2975d7c655 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/assertions/document/MsAssertionDocument.java +++ b/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/assertions/document/MsAssertionDocument.java @@ -7,4 +7,5 @@ public class MsAssertionDocument { private boolean enable = true; private String type; private Document data; + private String label; } diff --git a/api-test/frontend/src/business/definition/components/assertion/ApiAssertionDuration.vue b/api-test/frontend/src/business/definition/components/assertion/ApiAssertionDuration.vue index 02312bd13f..53afd24387 100644 --- a/api-test/frontend/src/business/definition/components/assertion/ApiAssertionDuration.vue +++ b/api-test/frontend/src/business/definition/components/assertion/ApiAssertionDuration.vue @@ -3,7 +3,7 @@ - + {{ $t('api_test.request.assertions.add') }} @@ -53,6 +53,10 @@ export default { type: Boolean, default: false, }, + caseEnable: { + type: Boolean, + default: false, + }, }, created() { diff --git a/api-test/frontend/src/business/definition/components/assertion/ApiAssertionJsonPath.vue b/api-test/frontend/src/business/definition/components/assertion/ApiAssertionJsonPath.vue index e16b1ec3a3..b6b6f8cdb4 100644 --- a/api-test/frontend/src/business/definition/components/assertion/ApiAssertionJsonPath.vue +++ b/api-test/frontend/src/business/definition/components/assertion/ApiAssertionJsonPath.vue @@ -4,7 +4,7 @@ - + {{ $t('api_test.request.assertions.add') }} @@ -97,6 +97,10 @@ export default { type: Boolean, default: false, }, + caseEnable: { + type: Boolean, + default: false, + }, }, created() { diff --git a/api-test/frontend/src/business/definition/components/assertion/ApiAssertionJsr223.vue b/api-test/frontend/src/business/definition/components/assertion/ApiAssertionJsr223.vue index e96961e2c4..9ef37c4b61 100644 --- a/api-test/frontend/src/business/definition/components/assertion/ApiAssertionJsr223.vue +++ b/api-test/frontend/src/business/definition/components/assertion/ApiAssertionJsr223.vue @@ -5,10 +5,10 @@ {{ assertion.desc }}
- + {{ $t('commons.edit') }} - + {{ $t('api_test.request.assertions.add') }}
@@ -19,16 +19,16 @@
- + - +
@@ -114,6 +114,10 @@ export default { type: Boolean, default: false, }, + caseEnable: { + type: Boolean, + default: false, + }, }, data() { diff --git a/api-test/frontend/src/business/definition/components/assertion/ApiAssertionRegex.vue b/api-test/frontend/src/business/definition/components/assertion/ApiAssertionRegex.vue index 491b74c3bd..b94b86e4a9 100644 --- a/api-test/frontend/src/business/definition/components/assertion/ApiAssertionRegex.vue +++ b/api-test/frontend/src/business/definition/components/assertion/ApiAssertionRegex.vue @@ -3,7 +3,7 @@ - + {{ $t('api_test.request.assertions.ignore_status') }} @@ -34,26 +34,26 @@ v-model="regex.enable" class="enable-switch" size="mini" - :disabled="isReadOnly && !regex.label" + :disabled="(isReadOnly && !regex.label) || caseEnable" style="width: 30px; margin-right: 10px" /> - + {{ $t('api_test.request.assertions.add') }} @@ -84,6 +84,10 @@ export default { type: Boolean, default: false, }, + caseEnable: { + type: Boolean, + default: false, + }, }, data() { diff --git a/api-test/frontend/src/business/definition/components/assertion/ApiAssertionXPath2.vue b/api-test/frontend/src/business/definition/components/assertion/ApiAssertionXPath2.vue index 9e606be2a7..b713cf7533 100644 --- a/api-test/frontend/src/business/definition/components/assertion/ApiAssertionXPath2.vue +++ b/api-test/frontend/src/business/definition/components/assertion/ApiAssertionXPath2.vue @@ -3,7 +3,7 @@ - + {{ $t('api_test.request.assertions.add') }} @@ -65,6 +65,10 @@ export default { type: Boolean, default: false, }, + caseEnable: { + type: Boolean, + default: false, + }, }, created() { diff --git a/api-test/frontend/src/business/definition/components/assertion/ApiAssertions.vue b/api-test/frontend/src/business/definition/components/assertion/ApiAssertions.vue index d887f87e72..e5e19b8672 100644 --- a/api-test/frontend/src/business/definition/components/assertion/ApiAssertions.vue +++ b/api-test/frontend/src/business/definition/components/assertion/ApiAssertions.vue @@ -80,6 +80,7 @@ :assertions="assertions" :apiId="apiId" :reloadData="reloadData" + :case-enable="request.caseEnable" style="margin-bottom: 20px" /> !item.label ); this.assertions.jsonPath = tmpArr; + }else { + this.assertions.jsonPath = []; } }, }, diff --git a/api-test/frontend/src/business/definition/components/assertion/ApiAssertionsEdit.vue b/api-test/frontend/src/business/definition/components/assertion/ApiAssertionsEdit.vue index 5877067ac7..71e3d9ce4a 100644 --- a/api-test/frontend/src/business/definition/components/assertion/ApiAssertionsEdit.vue +++ b/api-test/frontend/src/business/definition/components/assertion/ApiAssertionsEdit.vue @@ -6,6 +6,7 @@ @@ -18,6 +19,7 @@ @@ -28,7 +30,7 @@
XPath + :disabled="caseEnable "> @@ -42,6 +44,7 @@ @@ -54,6 +57,7 @@ @@ -65,6 +69,7 @@
@@ -80,7 +85,7 @@ v-model="assertions.document.enable" class="enable-switch" size="mini" - :disabled="isReadOnly && !assertions.document.label" + :disabled="(isReadOnly && !assertions.document.label) || caseEnable" style="width: 30px; margin-right: 10px" /> @@ -90,12 +95,12 @@ size="mini" circle @click="remove()" - :disabled="isReadOnly && !assertions.document.label && !assertions.root" /> + :disabled="(isReadOnly && !assertions.document.label && !assertions.root) || caseEnable" />
- +
@@ -127,6 +132,10 @@ export default { type: Boolean, default: false, }, + caseEnable: { + type: Boolean, + default: false, + }, }, data() { return {