diff --git a/backend/src/main/java/io/metersphere/api/dto/automation/parse/MsJmeterParser.java b/backend/src/main/java/io/metersphere/api/dto/automation/parse/MsJmeterParser.java index 852b3b9755..e995df3c49 100644 --- a/backend/src/main/java/io/metersphere/api/dto/automation/parse/MsJmeterParser.java +++ b/backend/src/main/java/io/metersphere/api/dto/automation/parse/MsJmeterParser.java @@ -214,6 +214,8 @@ public class MsJmeterParser extends ApiImportAbstractParser { samplerProxy.getBody().setKvs(keyValues); } samplerProxy.setProtocol(RequestType.HTTP); + samplerProxy.setConnectTimeout(source.getConnectTimeout()+""); + samplerProxy.setResponseTimeout(source.getResponseTimeout()+""); samplerProxy.setPort(source.getPropertyAsString("HTTPSampler.port")); samplerProxy.setDomain(source.getDomain()); if (source.getArguments() != null) { @@ -239,6 +241,7 @@ public class MsJmeterParser extends ApiImportAbstractParser { samplerProxy.setMethod(source.getMethod()); if (this.getUrl(source) != null) { samplerProxy.setUrl(this.getUrl(source)); + samplerProxy.setPath(null); } samplerProxy.setId(UUID.randomUUID().toString()); samplerProxy.setType("HTTPSamplerProxy"); diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java index da58252890..74e804c3f0 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java @@ -91,9 +91,6 @@ public class MsHTTPSamplerProxy extends MsTestElement { @JSONField(ordinal = 36) private MsAuthManager authManager; - @JSONField(ordinal = 37) - private boolean urlOrPath; - @Override public void toHashTree(HashTree tree, List hashTree, ParameterConfig config) { // 非导出操作,且不是启用状态则跳过执行 @@ -198,10 +195,11 @@ public class MsHTTPSamplerProxy extends MsTestElement { } URL urlObject = new URL(url); sampler.setDomain(URLDecoder.decode(urlObject.getHost(), "UTF-8")); - if (urlObject.getPort() > 0 && urlObject.getPort() != 10990 && StringUtils.isNotEmpty(this.getPort()) && this.getPort().startsWith("${")) { - sampler.setPort(urlObject.getPort()); - } else { + if (urlObject.getPort() > 0 && urlObject.getPort() == 10990 && StringUtils.isNotEmpty(this.getPort()) && this.getPort().startsWith("${")) { sampler.setProperty("HTTPSampler.port", this.getPort()); + + } else { + sampler.setPort(urlObject.getPort()); } sampler.setProtocol(urlObject.getProtocol()); String envPath = StringUtils.equals(urlObject.getPath(), "/") ? "" : urlObject.getPath(); diff --git a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java index 0e70693f40..7884538fcc 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java @@ -264,15 +264,7 @@ public class ApiDefinitionService { test.setEnvironmentId(request.getEnvironmentId()); test.setUserId(request.getUserId()); test.setTags(request.getTags()); - if (StringUtils.isEmpty(request.getModuleId()) || "default-module".equals(request.getModuleId())) { - ApiModuleExample example = new ApiModuleExample(); - example.createCriteria().andProjectIdEqualTo(test.getProjectId()).andProtocolEqualTo(test.getProtocol()).andNameEqualTo("默认模块"); - List modules = apiModuleMapper.selectByExample(example); - if (CollectionUtils.isNotEmpty(modules)) { - test.setModuleId(modules.get(0).getId()); - test.setModulePath(modules.get(0).getName()); - } - } + this.setModule(test); apiDefinitionMapper.updateByPrimaryKeySelective(test); return test; } @@ -591,6 +583,17 @@ public class ApiDefinitionService { return apiTestCaseMapper.selectByPrimaryKey(apiCaseId); } + private void setModule(ApiDefinitionWithBLOBs item) { + if (item != null && StringUtils.isEmpty(item.getModuleId()) || "default-module".equals(item.getModuleId())) { + ApiModuleExample example = new ApiModuleExample(); + example.createCriteria().andProjectIdEqualTo(item.getProjectId()).andProtocolEqualTo(item.getProtocol()).andNameEqualTo("默认模块"); + List modules = apiModuleMapper.selectByExample(example); + if (CollectionUtils.isNotEmpty(modules)) { + item.setModuleId(modules.get(0).getId()); + item.setModulePath(modules.get(0).getName()); + } + } + } public ApiDefinitionImport apiTestImport(MultipartFile file, ApiTestImportRequest request) { ApiImportParser apiImportParser = ApiDefinitionImportParserFactory.getApiImportParser(request.getPlatform()); @@ -616,15 +619,7 @@ public class ApiDefinitionService { } for (int i = 0; i < data.size(); i++) { ApiDefinitionWithBLOBs item = data.get(i); - if (StringUtils.isEmpty(item.getModuleId()) || "default-module".equals(item.getModuleId())) { - ApiModuleExample example = new ApiModuleExample(); - example.createCriteria().andProjectIdEqualTo(item.getProjectId()).andProtocolEqualTo(item.getProtocol()).andNameEqualTo("默认模块"); - List modules = apiModuleMapper.selectByExample(example); - if (CollectionUtils.isNotEmpty(modules)) { - item.setModuleId(modules.get(0).getId()); - item.setModulePath(modules.get(0).getName()); - } - } + this.setModule(item); if (item.getName().length() > 255) { item.setName(item.getName().substring(0, 255)); } diff --git a/backend/src/main/java/io/metersphere/excel/listener/TestCaseDataListener.java b/backend/src/main/java/io/metersphere/excel/listener/TestCaseDataListener.java index ba941aad35..05615842c0 100644 --- a/backend/src/main/java/io/metersphere/excel/listener/TestCaseDataListener.java +++ b/backend/src/main/java/io/metersphere/excel/listener/TestCaseDataListener.java @@ -142,7 +142,7 @@ public class TestCaseDataListener extends EasyExcelListener { public void saveData() { //excel中用例都有错误时就返回,只要有用例可用于更新或者插入就不返回 - if (!errList.isEmpty() && list.size() == 0 && updateList.size() == 0) { + if (!errList.isEmpty()) { return; } @@ -231,15 +231,23 @@ public class TestCaseDataListener extends EasyExcelListener { */ public String modifyTagPattern(TestCaseExcelData data){ String tags = data.getTags(); - if (tags != null) { - Stream stringStream = Arrays.stream(tags.split("[,;,;]")); //当标签值以中英文的逗号和分号分隔时才能正确解析 - List tagList = stringStream.map(tag -> tag = "\"" + tag + "\"") - .collect(Collectors.toList()); - String modifiedTags = StringUtils.join(tagList, ","); - modifiedTags = "[" + modifiedTags + "]"; - return modifiedTags; - }else { - return null; + try { + if (StringUtils.isNotBlank(tags)) { + JSONArray.parse(tags); + return tags; + } + return "[]"; + } catch (Exception e) { + if (tags != null) { + Stream stringStream = Arrays.stream(tags.split("[,;,;]")); //当标签值以中英文的逗号和分号分隔时才能正确解析 + List tagList = stringStream.map(tag -> tag = "\"" + tag + "\"") + .collect(Collectors.toList()); + String modifiedTags = StringUtils.join(tagList, ","); + modifiedTags = "[" + modifiedTags + "]"; + return modifiedTags; + } else { + return "[]"; + } } } diff --git a/backend/src/main/java/io/metersphere/track/service/TestCaseService.java b/backend/src/main/java/io/metersphere/track/service/TestCaseService.java index f6710f1bfa..d51e8955be 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestCaseService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestCaseService.java @@ -423,7 +423,7 @@ public class TestCaseService { testcase.setSort(sort.getAndIncrement()); testcase.setNum(num.decrementAndGet()); testcase.setReviewStatus(TestCaseReviewStatus.Prepare.name()); - mapper.insert(testcase); + mapper.insert(testcase); }); } sqlSession.flushStatements(); @@ -451,7 +451,7 @@ public class TestCaseService { /** * 把Excel中带ID的数据更新到数据库 - * + * feat(测试跟踪):通过Excel导入导出时有ID字段,可通过Excel导入来更新用例。 (#1727) * @param testCases * @param projectId */ diff --git a/backend/src/main/java/org/apache/jmeter/assertions/JSONPathAssertion.java b/backend/src/main/java/org/apache/jmeter/assertions/JSONPathAssertion.java index 44a93bb84c..f841c5d255 100644 --- a/backend/src/main/java/org/apache/jmeter/assertions/JSONPathAssertion.java +++ b/backend/src/main/java/org/apache/jmeter/assertions/JSONPathAssertion.java @@ -1,30 +1,20 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by Fernflower decompiler) +// package org.apache.jmeter.assertions; +import com.jayway.jsonpath.JsonPath; +import com.jayway.jsonpath.Predicate; + import java.io.Serializable; import java.text.DecimalFormat; import java.util.Map; +import java.util.function.Supplier; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.jayway.jsonpath.JsonPath; +import net.minidev.json.JSONArray; +import net.minidev.json.JSONObject; import org.apache.commons.lang3.StringUtils; import org.apache.jmeter.samplers.SampleResult; import org.apache.jmeter.testelement.AbstractTestElement; @@ -34,12 +24,6 @@ import org.apache.oro.text.regex.Pattern; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** - * This is main class for JSONPath Assertion which verifies assertion on - * previous sample result using JSON path expression - * - * @since 4.0 - */ public class JSONPathAssertion extends AbstractTestElement implements Serializable, Assertion, ThreadListener { private static final Logger log = LoggerFactory.getLogger(JSONPathAssertion.class); private static final long serialVersionUID = 2L; @@ -49,119 +33,118 @@ public class JSONPathAssertion extends AbstractTestElement implements Serializab public static final String EXPECT_NULL = "EXPECT_NULL"; public static final String INVERT = "INVERT"; public static final String ISREGEX = "ISREGEX"; + private static ThreadLocal decimalFormatter = ThreadLocal.withInitial(JSONPathAssertion::createDecimalFormat); - private static ThreadLocal decimalFormatter = - ThreadLocal.withInitial(JSONPathAssertion::createDecimalFormat); + public JSONPathAssertion() { + } + + private static DecimalFormat createDecimalFormat() { + DecimalFormat decimalFormatter = new DecimalFormat("#.#"); + decimalFormatter.setMaximumFractionDigits(340); + decimalFormatter.setMinimumFractionDigits(1); + return decimalFormatter; + } public String getOption() { return getPropertyAsString("ASS_OPTION"); } - private static DecimalFormat createDecimalFormat() { - DecimalFormat decimalFormatter = new DecimalFormat("#.#"); - decimalFormatter.setMaximumFractionDigits(340); // java.text.DecimalFormat.DOUBLE_FRACTION_DIGITS == 340 - decimalFormatter.setMinimumFractionDigits(1); - return decimalFormatter; - } - public String getJsonPath() { - return getPropertyAsString(JSONPATH); + return this.getPropertyAsString("JSON_PATH"); } public void setJsonPath(String jsonPath) { - setProperty(JSONPATH, jsonPath); + this.setProperty("JSON_PATH", jsonPath); } public String getExpectedValue() { - return getPropertyAsString(EXPECTEDVALUE); + return this.getPropertyAsString("EXPECTED_VALUE"); } public void setExpectedValue(String expectedValue) { - setProperty(EXPECTEDVALUE, expectedValue); + this.setProperty("EXPECTED_VALUE", expectedValue); } public void setJsonValidationBool(boolean jsonValidation) { - setProperty(JSONVALIDATION, jsonValidation); + this.setProperty("JSONVALIDATION", jsonValidation); } public void setExpectNull(boolean val) { - setProperty(EXPECT_NULL, val); + this.setProperty("EXPECT_NULL", val); } public boolean isExpectNull() { - return getPropertyAsBoolean(EXPECT_NULL); + return this.getPropertyAsBoolean("EXPECT_NULL"); } public boolean isJsonValidationBool() { - return getPropertyAsBoolean(JSONVALIDATION); + return this.getPropertyAsBoolean("JSONVALIDATION"); } public void setInvert(boolean invert) { - setProperty(INVERT, invert); + this.setProperty("INVERT", invert); } public boolean isInvert() { - return getPropertyAsBoolean(INVERT); + return this.getPropertyAsBoolean("INVERT"); } public void setIsRegex(boolean flag) { - setProperty(ISREGEX, flag); + this.setProperty("ISREGEX", flag); } public boolean isUseRegex() { - return getPropertyAsBoolean(ISREGEX, true); + return this.getPropertyAsBoolean("ISREGEX", true); } private void doAssert(String jsonString) { - Object value = JsonPath.read(jsonString, getJsonPath()); - - if (!isJsonValidationBool()) { - return; - } - - if (value instanceof JSONArray) { - if (arrayMatched((JSONArray) value)) { + Object value = JsonPath.read(jsonString, this.getJsonPath(), new Predicate[0]); + if (this.isJsonValidationBool()) { + if (value instanceof JSONArray) { + if (this.arrayMatched((JSONArray) value)) { + return; + } + } else if (this.isExpectNull() && value == null || this.isEquals(value)) { return; } - } else { - if ((isExpectNull() && value == null) - || isEquals(value)) { - return; - } - } - if (isExpectNull()) { - throw new IllegalStateException(String.format("Value expected to be null, but found '%s'", value)); - } else { - String msg; - if (isUseRegex()) { - msg = "Value expected to match regexp '%s', but it did not match: '%s'"; + if (this.isExpectNull()) { + throw new IllegalStateException(String.format("Value expected to be null, but found '%s'", value)); } else { - msg = "Value expected to be '%s', but found '%s'"; + String msg; + if (this.isUseRegex()) { + msg = "Value expected to match regexp '%s', but it did not match: '%s'"; + } else { + msg = "Value expected to be '%s', but found '%s'"; + } + + throw new IllegalStateException(String.format(msg, this.getExpectedValue(), objectToString(value))); } - throw new IllegalStateException(String.format(msg, getExpectedValue(), objectToString(value))); } } private boolean arrayMatched(JSONArray value) { - if (value.isEmpty() && "[]".equals(getExpectedValue())) { + if (value.isEmpty() && "[]".equals(this.getExpectedValue())) { return true; - } + } else { + Object[] var2 = value.toArray(); + int var3 = var2.length; - for (Object subj : value.toArray()) { - if ((subj == null && isExpectNull()) - || isEquals(subj)) { - return true; + for (int var4 = 0; var4 < var3; ++var4) { + Object subj = var2[var4]; + if (subj == null && this.isExpectNull() || this.isEquals(subj)) { + return true; + } } - } - return isEquals(value); + return this.isEquals(value); + } } private boolean isEquals(Object subj) { String str = objectToString(subj); - if (isUseRegex()) { - Pattern pattern = JMeterUtils.getPatternCache().getPattern(getExpectedValue()); + if (this.isUseRegex()) { + Pattern pattern = JMeterUtils.getPatternCache().getPattern(this.getExpectedValue()); return JMeterUtils.getMatcher().matches(str, pattern); } else { if (StringUtils.isNotEmpty(getOption())) { @@ -182,47 +165,46 @@ public class JSONPathAssertion extends AbstractTestElement implements Serializab } return refFlag; } - return str.equals(getExpectedValue()); + return str.equals(this.getExpectedValue()); } } - @Override public AssertionResult getResult(SampleResult samplerResult) { - AssertionResult result = new AssertionResult(getName()); + AssertionResult result = new AssertionResult(this.getName()); String responseData = samplerResult.getResponseDataAsString(); if (responseData.isEmpty()) { return result.setResultForNull(); - } - - result.setFailure(false); - result.setFailureMessage(""); - - if (!isInvert()) { - try { - doAssert(responseData); - } catch (Exception e) { - log.debug("Assertion failed", e); - result.setFailure(true); - result.setFailureMessage(e.getMessage()); - } } else { - try { - doAssert(responseData); - result.setFailure(true); - if (isJsonValidationBool()) { - if (isExpectNull()) { - result.setFailureMessage("Failed that JSONPath " + getJsonPath() + " not matches null"); - } else { - result.setFailureMessage("Failed that JSONPath " + getJsonPath() + " not matches " + getExpectedValue()); - } - } else { - result.setFailureMessage("Failed that JSONPath not exists: " + getJsonPath()); + result.setFailure(false); + result.setFailureMessage(""); + if (!this.isInvert()) { + try { + this.doAssert(responseData); + } catch (Exception var6) { + log.debug("Assertion failed", var6); + result.setFailure(true); + result.setFailureMessage(var6.getMessage()); + } + } else { + try { + this.doAssert(responseData); + result.setFailure(true); + if (this.isJsonValidationBool()) { + if (this.isExpectNull()) { + result.setFailureMessage("Failed that JSONPath " + this.getJsonPath() + " not matches null"); + } else { + result.setFailureMessage("Failed that JSONPath " + this.getJsonPath() + " not matches " + this.getExpectedValue()); + } + } else { + result.setFailureMessage("Failed that JSONPath not exists: " + this.getJsonPath()); + } + } catch (Exception var5) { + log.debug("Assertion failed, as expected", var5); } - } catch (Exception e) { - log.debug("Assertion failed, as expected", e); } + + return result; } - return result; } public static String objectToString(Object subj) { @@ -230,22 +212,19 @@ public class JSONPathAssertion extends AbstractTestElement implements Serializab if (subj == null) { str = "null"; } else if (subj instanceof Map) { - //noinspection unchecked - str = new JSONObject((Map) subj).toJSONString(); - } else if (subj instanceof Double || subj instanceof Float) { - str = decimalFormatter.get().format(subj); - } else { + str = (new JSONObject((Map) subj)).toJSONString(); + } else if (!(subj instanceof Double) && !(subj instanceof Float)) { str = subj.toString(); + } else { + str = ((DecimalFormat) decimalFormatter.get()).format(subj); } + return str; } - @Override public void threadStarted() { - // nothing to do on thread start } - @Override public void threadFinished() { decimalFormatter.remove(); } diff --git a/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue b/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue index 5fc080fa6e..c6c9e7a3f0 100644 --- a/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue +++ b/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue @@ -441,18 +441,14 @@ export default { } }); - if (this.$refs.scenarioTable) { - setTimeout(() => { - this.$refs.scenarioTable.doLayout(); - this.result.loading = false; - }, 500) - } - if (!this.condition.selectAll) { this.condition.unSelectIds = response.data.listObject.map(s => s.id); } this.$nextTick(function () { + if (this.$refs.scenarioTable) { + setTimeout(this.$refs.scenarioTable.doLayout, 200) + } this.checkTableRowIsSelect(); }) }); @@ -732,8 +728,8 @@ export default { // let ids = [row.id]; let param = {}; this.buildBatchParam(param); - if(param.ids && param.ids.length <=0){ - param.ids =[row.id]; + if (param.ids && param.ids.length <= 0) { + param.ids = [row.id]; } this.$post('/api/automation/removeToGcByBatch/', param, () => { // this.$post('/api/automation/removeToGc/', ids, () => { @@ -838,4 +834,8 @@ export default { /deep/ .el-card__header { padding: 10px; } + +/deep/ .el-table__fixed-body-wrapper { + top: 60px !important; +} diff --git a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue index 09d3cdf8ce..48fc69aa8d 100644 --- a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue +++ b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue @@ -767,7 +767,7 @@ }, runDebug() { /*触发执行操作*/ - let sign = this.$refs.envPopover.checkEnv(); + let sign = this.$refs.envPopover.checkEnv(this.scenarioDefinition); if (!sign) { return; } diff --git a/frontend/src/business/components/api/automation/scenario/EnvPopover.vue b/frontend/src/business/components/api/automation/scenario/EnvPopover.vue index bc7296c026..32580f3be9 100644 --- a/frontend/src/business/components/api/automation/scenario/EnvPopover.vue +++ b/frontend/src/business/components/api/automation/scenario/EnvPopover.vue @@ -44,8 +44,8 @@ export default { setProjectEnvMap(map) { this.$emit("setProjectEnvMap", map); }, - checkEnv() { - return this.$refs.envSelect.checkEnv(); + checkEnv(data) { + return this.$refs.envSelect.checkEnv(data); } } diff --git a/frontend/src/business/components/api/automation/scenario/EnvSelect.vue b/frontend/src/business/components/api/automation/scenario/EnvSelect.vue index 87c62495f0..27a4cb1918 100644 --- a/frontend/src/business/components/api/automation/scenario/EnvSelect.vue +++ b/frontend/src/business/components/api/automation/scenario/EnvSelect.vue @@ -29,133 +29,258 @@ diff --git a/frontend/src/business/components/api/automation/scenario/variable/VariableList.vue b/frontend/src/business/components/api/automation/scenario/variable/VariableList.vue index 493fae9fb5..8f23c32cb6 100644 --- a/frontend/src/business/components/api/automation/scenario/variable/VariableList.vue +++ b/frontend/src/business/components/api/automation/scenario/variable/VariableList.vue @@ -226,7 +226,7 @@ this.headers = headers; } this.visible = true; - this.editData = {type: "CONSTANT"}; + this.editData = {type: "CONSTANT", delimiter: ","}; this.addParameters(this.editData); this.disabled = disabled; }, diff --git a/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue b/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue index 444e701fde..da43f454f7 100644 --- a/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue +++ b/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue @@ -313,7 +313,7 @@ export default { this.condition.status = "Trash"; this.condition.moduleIds = []; } - if(!this.selectAll){ + if (!this.selectAll) { this.selectAll = false; this.unSelection = []; this.selectDataCounts = 0; @@ -342,7 +342,7 @@ export default { this.total = response.data.itemCount; this.tableData = response.data.listObject; - if(!this.selectAll){ + if (!this.selectAll) { this.unSelection = response.data.listObject.map(s => s.id); } @@ -351,13 +351,11 @@ export default { item.tags = JSON.parse(item.tags); } }) - if (this.$refs.caseTable) { - setTimeout(() => { - this.$refs.caseTable.doLayout(); - this.result.loading = false; - }, 500) - } - this.$nextTick(function(){ + + this.$nextTick(function () { + if (this.$refs.caseTable) { + setTimeout(this.$refs.caseTable.doLayout, 200) + } this.checkTableRowIsSelect(); }) }); @@ -365,20 +363,20 @@ export default { getLabel(this, API_CASE_LIST); }, - checkTableRowIsSelect(){ + checkTableRowIsSelect() { //如果默认全选的话,则选中应该选中的行 - if(this.selectAll){ + if (this.selectAll) { let unSelectIds = this.unSelection; - this.tableData.forEach(row=>{ - if(unSelectIds.indexOf(row.id)<0){ - this.$refs.caseTable.toggleRowSelection(row,true); + this.tableData.forEach(row => { + if (unSelectIds.indexOf(row.id) < 0) { + this.$refs.caseTable.toggleRowSelection(row, true); //默认全选,需要把选中对行添加到selectRows中。不然会影响到勾选函数统计 if (!this.selectRows.has(row)) { this.$set(row, "showMore", true); this.selectRows.add(row); } - }else{ + } else { //不勾选的行,也要判断是否被加入了selectRow中。加入了的话就去除。 if (this.selectRows.has(row)) { this.$set(row, "showMore", false); @@ -694,4 +692,8 @@ export default { /deep/ .el-table__fixed { height: 100% !important; } + +/deep/ .el-table__fixed-body-wrapper { + top: 60px !important; +} diff --git a/frontend/src/business/components/api/definition/components/list/ApiList.vue b/frontend/src/business/components/api/definition/components/list/ApiList.vue index 970b67ac12..c13957ac04 100644 --- a/frontend/src/business/components/api/definition/components/list/ApiList.vue +++ b/frontend/src/business/components/api/definition/components/list/ApiList.vue @@ -116,7 +116,8 @@ min-width="120px" :key="index"> @@ -211,101 +212,315 @@ diff --git a/frontend/src/business/components/api/definition/components/module/ApiModule.vue b/frontend/src/business/components/api/definition/components/module/ApiModule.vue index 1d2e735ff6..22a88d9139 100644 --- a/frontend/src/business/components/api/definition/components/module/ApiModule.vue +++ b/frontend/src/business/components/api/definition/components/module/ApiModule.vue @@ -133,11 +133,16 @@ this.data.forEach(node => { buildTree(node, {path: ''}); }); - this.$emit('setModuleOptions', this.data); this.$emit('setNodeTree', this.data); if (this.$refs.nodeTree) { this.$refs.nodeTree.filter(this.condition.filterText); } + let moduleOptions = []; + this.data.forEach(node => { + buildNodePath(node, {path: ''}, moduleOptions); + }); + this.moduleOptions = moduleOptions; + this.$emit('setModuleOptions', moduleOptions); } }); }, diff --git a/frontend/src/business/components/performance/test/components/ExistFiles.vue b/frontend/src/business/components/performance/test/components/ExistFiles.vue index e264843c2b..b2cd851e1a 100644 --- a/frontend/src/business/components/performance/test/components/ExistFiles.vue +++ b/frontend/src/business/components/performance/test/components/ExistFiles.vue @@ -173,11 +173,12 @@ export default { updateTime: row.lastModified, }); } + // + rows.forEach(row => { + this.fileList.push(row); + }) if (this.loadType === 'resource') { - rows.forEach(row => { - this.fileList.push(row); - }) this.$success(this.$t('test_track.case.import.success')); this.close(); return; @@ -197,8 +198,6 @@ export default { tg.options = {}; this.scenarios.push(tg); }); - let file = new File([d.jmx], d.name); - this.uploadList.push(file); }); this.$emit('fileChange', this.scenarios); diff --git a/frontend/src/business/components/track/case/components/TestCaseList.vue b/frontend/src/business/components/track/case/components/TestCaseList.vue index 6d6a77b7e8..0ed5bf3334 100644 --- a/frontend/src/business/components/track/case/components/TestCaseList.vue +++ b/frontend/src/business/components/track/case/components/TestCaseList.vue @@ -2,128 +2,128 @@
- - + + + + + + + + + +