diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/MsTestElement.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/MsTestElement.java index 3bfecbfc1b..9081052660 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/MsTestElement.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/MsTestElement.java @@ -12,6 +12,7 @@ import io.metersphere.api.dto.definition.request.auth.MsAuthManager; import io.metersphere.api.dto.definition.request.configurations.MsHeaderManager; import io.metersphere.api.dto.definition.request.controller.MsIfController; import io.metersphere.api.dto.definition.request.extract.MsExtract; +import io.metersphere.api.dto.definition.request.processors.MsJSR223Processor; import io.metersphere.api.dto.definition.request.processors.post.MsJSR223PostProcessor; import io.metersphere.api.dto.definition.request.processors.pre.MsJSR223PreProcessor; import io.metersphere.api.dto.definition.request.sampler.MsDubboSampler; @@ -37,6 +38,7 @@ import java.util.List; @JsonSubTypes({ @JsonSubTypes.Type(value = MsHTTPSamplerProxy.class, name = "HTTPSamplerProxy"), @JsonSubTypes.Type(value = MsHeaderManager.class, name = "HeaderManager"), + @JsonSubTypes.Type(value = MsJSR223Processor.class, name = "JSR223Processor"), @JsonSubTypes.Type(value = MsJSR223PostProcessor.class, name = "JSR223PostProcessor"), @JsonSubTypes.Type(value = MsJSR223PreProcessor.class, name = "JSR223PreProcessor"), @JsonSubTypes.Type(value = MsTestPlan.class, name = "TestPlan"), @@ -52,7 +54,7 @@ import java.util.List; @JsonSubTypes.Type(value = MsScenario.class, name = "scenario"), }) -@JSONType(seeAlso = {MsHTTPSamplerProxy.class, MsHeaderManager.class, MsJSR223PostProcessor.class, +@JSONType(seeAlso = {MsHTTPSamplerProxy.class, MsHeaderManager.class, MsJSR223Processor.class, MsJSR223PostProcessor.class, MsJSR223PreProcessor.class, MsTestPlan.class, MsThreadGroup.class, AuthManager.class, MsAssertions.class, MsExtract.class, MsTCPSampler.class, MsDubboSampler.class, MsJDBCSampler.class, MsConstantTimer.class, MsIfController.class, MsScenario.class}, typeKey = "type") @Data @@ -118,7 +120,8 @@ public abstract class MsTestElement { ObjectMapper mapper = new ObjectMapper(); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); ApiDefinitionWithBLOBs apiDefinition = apiDefinitionService.getBLOBs(this.getId()); - element = mapper.readValue(apiDefinition.getRequest(), new TypeReference() {}); + element = mapper.readValue(apiDefinition.getRequest(), new TypeReference() { + }); hashTree.add(element); } catch (Exception ex) { ex.printStackTrace(); diff --git a/backend/src/main/java/io/metersphere/xmind/XmindCaseParser.java b/backend/src/main/java/io/metersphere/xmind/XmindCaseParser.java index d08eea9ab3..939b8f3730 100644 --- a/backend/src/main/java/io/metersphere/xmind/XmindCaseParser.java +++ b/backend/src/main/java/io/metersphere/xmind/XmindCaseParser.java @@ -14,6 +14,7 @@ import io.metersphere.xmind.parser.XmindParser; import io.metersphere.xmind.parser.pojo.Attached; import io.metersphere.xmind.parser.pojo.JsonRootBean; import io.metersphere.xmind.utils.DetailUtil; +import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.web.multipart.MultipartFile; @@ -185,7 +186,7 @@ public class XmindCaseParser { String nodePath = parent.getPath() + "/" + item.getTitle(); item.setPath(nodePath); item.setParent(parent); - if (item.getChildren() != null && !item.getChildren().getAttached().isEmpty()) { + if (item.getChildren() != null && CollectionUtils.isNotEmpty(item.getChildren().getAttached())) { recursion(item, level + 1, item.getChildren().getAttached()); } else { if (!nodePath.startsWith("/")) { diff --git a/frontend/src/business/components/api/automation/scenario/ApiComponent.vue b/frontend/src/business/components/api/automation/scenario/ApiComponent.vue index b9e53b1527..291411c4e9 100644 --- a/frontend/src/business/components/api/automation/scenario/ApiComponent.vue +++ b/frontend/src/business/components/api/automation/scenario/ApiComponent.vue @@ -2,20 +2,30 @@
-
+
{{request.index}}
{{request.index}}
+ + {{$t('api_test.automation.api_list_import')}} + + + + {{$t('api_test.automation.customize_req')}} + + - {{request.type!= 'create' ? request.name:''}} + {{request.name}} + + {{$t('api_test.automation.reference_deleted')}} {{ $t('api_test.scenario.reference') }} - + @@ -112,6 +122,12 @@ color: #F56C6C; } + .ms-left-buttion { + color: #F56C6C; + background-color: #FCF1F1; + margin-right: 20px; + } + .ms-api-col-create { background-color: #EBF2F2; border-color: #008080; @@ -127,6 +143,12 @@ transform: rotate(90deg); } + .ms-create-buttion { + color: #008080; + background-color: #EBF2F2; + margin-right: 20px; + } + .tip { padding: 3px 5px; font-size: 16px; diff --git a/frontend/src/business/components/api/automation/scenario/ApiCustomize.vue b/frontend/src/business/components/api/automation/scenario/ApiCustomize.vue index 14504123f0..d3cadaa685 100644 --- a/frontend/src/business/components/api/automation/scenario/ApiCustomize.vue +++ b/frontend/src/business/components/api/automation/scenario/ApiCustomize.vue @@ -61,7 +61,9 @@ this.request.method = row.method; } this.request.resourceId = getUUID(); - this.$emit('addCustomizeApi', this.request); + let obj = {}; + Object.assign(obj, this.request); + this.$emit('addCustomizeApi', obj); }, reload() { this.loading = true diff --git a/frontend/src/business/components/api/automation/scenario/ApiScenarioComponent.vue b/frontend/src/business/components/api/automation/scenario/ApiScenarioComponent.vue index e9d95708d2..d7ec1e73fc 100644 --- a/frontend/src/business/components/api/automation/scenario/ApiScenarioComponent.vue +++ b/frontend/src/business/components/api/automation/scenario/ApiScenarioComponent.vue @@ -2,13 +2,14 @@
-
+
{{scenario.index}}
-
{{scenario.name}}
+ {{$t('api_test.automation.wait_controller')}} + {{scenario.name}} {{$t('api_test.automation.reference_deleted')}} {{ $t('api_test.scenario.reference') }} - +
@@ -73,6 +74,12 @@ padding: 15px; } + .ms-title-buttion { + background-color: #F4F4F5; + margin-right: 20px; + color: #606266; + } + .icon.is-active { transform: rotate(90deg); } diff --git a/frontend/src/business/components/api/automation/scenario/ConstantTimer.vue b/frontend/src/business/components/api/automation/scenario/ConstantTimer.vue index 3b37f29e17..9afc363ad4 100644 --- a/frontend/src/business/components/api/automation/scenario/ConstantTimer.vue +++ b/frontend/src/business/components/api/automation/scenario/ConstantTimer.vue @@ -2,24 +2,14 @@
-
+
{{timer.index}}
-
- - {{ $t('api_test.request.wait') }} - - - - ms - - - - - - - -
+ {{$t('api_test.automation.wait_controller')}} + + ms + +
@@ -37,7 +27,7 @@ }, methods: { remove() { - this.$emit('remove', this.timer,this.node); + this.$emit('remove', this.timer, this.node); } } } @@ -45,7 +35,7 @@ diff --git a/frontend/src/business/components/api/automation/scenario/IfController.vue b/frontend/src/business/components/api/automation/scenario/IfController.vue index 3faf9cd714..c83f68f986 100644 --- a/frontend/src/business/components/api/automation/scenario/IfController.vue +++ b/frontend/src/business/components/api/automation/scenario/IfController.vue @@ -1,32 +1,23 @@ @@ -102,4 +93,10 @@ margin-right: 10px; color: #E6A23C; } + + .ms-title-buttion { + background-color: #FCF6EE; + margin-right: 20px; + color: #E6A23C; + } diff --git a/frontend/src/business/components/api/automation/scenario/Jsr233Processor.vue b/frontend/src/business/components/api/automation/scenario/Jsr233Processor.vue index 84cf0b87c2..6c7b184f97 100644 --- a/frontend/src/business/components/api/automation/scenario/Jsr233Processor.vue +++ b/frontend/src/business/components/api/automation/scenario/Jsr233Processor.vue @@ -7,8 +7,9 @@
{{title}} - - {{$t('commons.remove')}} + + +
diff --git a/frontend/src/business/components/api/definition/components/assertion/ApiAssertions.vue b/frontend/src/business/components/api/definition/components/assertion/ApiAssertions.vue index a1acb6ab91..7854042b7c 100644 --- a/frontend/src/business/components/api/definition/components/assertion/ApiAssertions.vue +++ b/frontend/src/business/components/api/definition/components/assertion/ApiAssertions.vue @@ -6,40 +6,49 @@
{{assertions.index}}
{{$t('api_test.definition.request.assertions_rule')}} - {{$t('commons.remove')}} -
-
- - - - - - - - - - - - - - - - - - {{ $t('api_test.request.assertions.add') }} - - - -
- + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + {{ $t('api_test.request.assertions.add') }} + + + +
+ + +
+
@@ -72,7 +81,7 @@ node: {}, request: {}, customizeStyle: { - type:String, + type: String, default: "margin-top: 10px" }, scenario: Scenario, @@ -111,8 +120,12 @@ this.loading = false }) }, + active(item) { + item.active = !item.active; + this.reload(); + }, remove() { - this.$emit('remove', this.assertions,this.node); + this.$emit('remove', this.assertions, this.node); }, addJsonpathSuggest(jsonPathList) { jsonPathList.forEach(jsonPath => { @@ -142,31 +155,10 @@ border-radius: 5px; } - .bg-purple-dark { - background: #99a9bf; + .icon.is-active { + transform: rotate(90deg); } - - .bg-purple { - background: #d3dce6; + /deep/ .el-card__body { + padding: 15px; } - - .bg-purple-light { - background: #e5e9f2; - } - - .grid-content { - border-radius: 4px; - min-height: 36px; - } - - .row-bg { - padding: 10px 0; - background-color: #f9fafc; - } - - .json-path-suggest-button { - margin-top: 20px; - margin-left: 20px; - } - diff --git a/frontend/src/business/components/api/definition/components/extract/ApiExtract.vue b/frontend/src/business/components/api/definition/components/extract/ApiExtract.vue index 292529fa9e..6f5511e981 100644 --- a/frontend/src/business/components/api/definition/components/extract/ApiExtract.vue +++ b/frontend/src/business/components/api/definition/components/extract/ApiExtract.vue @@ -1,35 +1,42 @@ @@ -66,6 +73,7 @@ options: EXTRACT_TYPE, type: "", reloadData: "", + loading: false, } }, @@ -77,9 +85,17 @@ remove() { this.$emit('remove', this.extract, this.node); }, - + reload() { + this.loading = true + this.$nextTick(() => { + this.loading = false + }) + }, + active(item) { + item.active = !item.active; + this.reload(); + }, }, - computed: { list() { switch (this.type) { @@ -113,4 +129,12 @@ margin: 5px 0; border-radius: 5px; } + + .icon.is-active { + transform: rotate(90deg); + } + + /deep/ .el-card__body { + padding: 15px; + } diff --git a/frontend/src/business/components/api/definition/components/processor/Jsr233Processor.vue b/frontend/src/business/components/api/definition/components/processor/Jsr233Processor.vue index e8816aba45..9b5fea875c 100644 --- a/frontend/src/business/components/api/definition/components/processor/Jsr233Processor.vue +++ b/frontend/src/business/components/api/definition/components/processor/Jsr233Processor.vue @@ -1,42 +1,44 @@ @@ -138,7 +140,7 @@ } this.reload(); }, - remove(){ + remove() { this.$emit('remove', this.jsr223ProcessorData); }, reload() { @@ -195,4 +197,7 @@ .icon.is-active { transform: rotate(90deg); } + /deep/ .el-card__body { + padding: 15px; + }