Merge branch 'master' of github.com:metersphere/metersphere

This commit is contained in:
chenjianxing 2021-03-19 13:44:56 +08:00
commit 6446024cf8
16 changed files with 63 additions and 38 deletions

View File

@ -174,7 +174,7 @@ public class MsJmeterParser extends ApiImportAbstractParser<ScenarioImport> {
}
}
}
samplerProxy.setPath(source.getPath());
samplerProxy.setPath("");
samplerProxy.setMethod(source.getMethod());
if (source.getUrl() != null) {
samplerProxy.setUrl(source.getUrl().toString());

View File

@ -137,7 +137,9 @@ public class MsHTTPSamplerProxy extends MsTestElement {
URL urlObject = new URL(url);
if (isUrl) {
sampler.setDomain(URLDecoder.decode(urlObject.getHost(), "UTF-8"));
if (urlObject.getPort() > 0) {
sampler.setPort(urlObject.getPort());
}
sampler.setProtocol(urlObject.getProtocol());
} else {
sampler.setDomain(config.getConfig().get(this.getProjectId()).getHttpConfig().getDomain());

View File

@ -96,11 +96,13 @@ public class ApiAutomationService {
List<ApiScenarioDTO> list = extApiScenarioMapper.list(request);
return list;
}
public List<ApiScenarioDTO> listReview(ApiScenarioRequest request) {
request = this.initRequest(request, true, true);
List<ApiScenarioDTO> list = extApiScenarioMapper.listReview(request);
return list;
}
private void setApiScenarioProjectIds(ApiScenarioDTO data) {
// 如果场景步骤涉及多项目则把涉及到的项目ID保存在projectIds属性
List<String> idList = new ArrayList<>();
@ -335,9 +337,10 @@ public class ApiAutomationService {
if (scenarioWithBLOBs != null) {
BeanUtils.copyBean(apiScenarioDTO, scenarioWithBLOBs);
setApiScenarioProjectIds(apiScenarioDTO);
}
return apiScenarioDTO;
}
return null;
}
public List<ApiScenarioWithBLOBs> getApiScenarios(List<String> ids) {
if (CollectionUtils.isNotEmpty(ids)) {
@ -715,14 +718,15 @@ public class ApiAutomationService {
testPlanApiScenarioMapper.insert(testPlanApiScenario);
});
}
public void relevanceReview(ApiCaseRelevanceRequest request){
public void relevanceReview(ApiCaseRelevanceRequest request) {
Map<String, List<String>> mapping = request.getMapping();
Map<String, String> envMap = request.getEnvMap();
Set<String> set = mapping.keySet();
if (set.isEmpty()) {
return;
}
set.forEach(id->{
set.forEach(id -> {
Map<String, String> newEnvMap = new HashMap<>(16);
if (envMap != null && !envMap.isEmpty()) {
List<String> list = mapping.get(id);
@ -730,7 +734,7 @@ public class ApiAutomationService {
newEnvMap.put(l, envMap.get(l));
});
}
TestCaseReviewScenario testCaseReviewScenario=new TestCaseReviewScenario();
TestCaseReviewScenario testCaseReviewScenario = new TestCaseReviewScenario();
testCaseReviewScenario.setId(UUID.randomUUID().toString());
testCaseReviewScenario.setApiScenarioId(id);
testCaseReviewScenario.setTestCaseReviewId(request.getReviewId());
@ -741,6 +745,7 @@ public class ApiAutomationService {
});
}
public List<ApiScenario> selectByIds(List<String> ids) {
ApiScenarioExample example = new ApiScenarioExample();
example.createCriteria().andIdIn(ids);

View File

@ -161,12 +161,12 @@
#{value}
</foreach>
</when>
<otherwise>
and test_case_review_test_case.status in
<when test="key=='status'">
and test_case.review_status in
<foreach collection="values" item="value" separator="," open="(" close=")">
#{value}
</foreach>
</otherwise>
</when>
</choose>
</if>
</foreach>

View File

@ -551,8 +551,8 @@ public class TestPlanService {
queryTestPlanRequest.setId(planId);
TestPlanDTO testPlan = extTestPlanMapper.list(queryTestPlanRequest).get(0);
String projectName = getProjectNameByPlanId(planId);
testPlan.setProjectName(projectName);
Project project = projectMapper.selectByPrimaryKey(testPlan.getProjectId());
testPlan.setProjectName(project.getName());
TestCaseReport testCaseReport = testCaseReportMapper.selectByPrimaryKey(testPlan.getReportId());
JSONObject content = JSONObject.parseObject(testCaseReport.getContent());
@ -708,8 +708,8 @@ public class TestPlanService {
queryTestPlanRequest.setId(planId);
TestPlanDTO testPlan = extTestPlanMapper.list(queryTestPlanRequest).get(0);
String projectName = getProjectNameByPlanId(planId);
testPlan.setProjectName(projectName);
Project project = projectMapper.selectByPrimaryKey(testPlan.getProjectId());
testPlan.setProjectName(project.getName());
TestCaseReport testCaseReport = testCaseReportMapper.selectByPrimaryKey(testPlan.getReportId());
JSONObject content = JSONObject.parseObject(testCaseReport.getContent());

@ -1 +1 @@
Subproject commit efd6af73b7c5cc53cd4515772000bc1436c49837
Subproject commit 245845e07bf3fe2f60311eeb78f8f109301a2d39

View File

@ -159,6 +159,10 @@ export default {
},
handleView(report) {
this.reportId = report.id;
if(report.status ==='Running'){
this.$warning("正在运行中,请稍后查看")
return;
}
this.currentProjectId = report.projectId;
this.$router.push({
path: 'report/view/' + report.id,

View File

@ -202,7 +202,7 @@
new URL(url);
this.request.url = url;
} catch (e) {
if (url) {
if (url && (!url.startsWith("http://") || !url.startsWith("https://"))) {
this.request.path = url;
this.request.url = undefined;
}

View File

@ -194,7 +194,7 @@
this.$emit('batchEditCase');
},
deleteCase(index, row) {
this.$alert(this.$t('api_test.definition.request.delete_confirm') + ' ' + row.name + " ", '', {
this.$alert(this.$t('api_test.definition.request.delete_case_confirm') + ' ' + row.name + " ", '', {
confirmButtonText: this.$t('commons.confirm'),
callback: (action) => {
if (action === 'confirm') {
@ -305,10 +305,6 @@
row.id = data.id;
row.createTime = data.createTime;
row.updateTime = data.updateTime;
if (!row.message) {
this.$success(this.$t('commons.save_success'));
this.$emit('refresh');
}
});
},
saveTestCase(row) {
@ -317,7 +313,6 @@
} else {
this.saveCase(row);
}
},
showInput(row) {
// row.type = "create";

View File

@ -94,8 +94,8 @@
<span class="default-property">
未通过
{{"\xa0\xa0"}}
<el-link type="info" @click="redirectPage('Pass')" target="_blank" style="color: #000000">
{{trackCountData.passCount}}
<el-link type="info" @click="redirectPage('UnPass')" target="_blank" style="color: #000000">
{{trackCountData.unPassCount}}
</el-link>
</span>
</el-col>
@ -103,8 +103,8 @@
<span class="main-property">
已通过
{{"\xa0\xa0"}}
<el-link type="info" @click="redirectPage('UnPass')" target="_blank" style="color: #000000">
{{trackCountData.unPassCount}}
<el-link type="info" @click="redirectPage('Pass')" target="_blank" style="color: #000000">
{{trackCountData.passCount}}
</el-link>
</span>
</el-col>

View File

@ -34,6 +34,7 @@
import MsDialogFooter from '../../../../../common/components/MsDialogFooter'
import SelectMenu from "../../../../common/SelectMenu";
import RelevanceDialog from "./RelevanceDialog";
import {getCurrentProjectID} from "@/common/js/utils";
export default {
name: "TestCaseRelevanceBase",
@ -93,11 +94,18 @@
this.result = this.$get("/project/listAll", res => {
let data = res.data;
if (data) {
const index = data.findIndex(d => d.id === getCurrentProjectID());
this.projects = data;
if (index !== -1) {
this.projectId = data[index].id;
this.projectName = data[index].name;
this.changeProject(data[index]);
} else {
this.projectId = data[0].id;
this.projectName = data[0].name;
this.changeProject(data[0]);
}
}
})
},

View File

@ -591,17 +591,23 @@ export default {
const project = res.data;
if (project.tapdId) {
this.hasTapdId = true;
this.result = this.$get("/issues/tapd/user/" + this.testCase.caseId, response => {
this.users = response.data;
this.result = this.$get("/issues/tapd/user/" + this.testCase.caseId).then(response => {
this.users = response.data.data;
}).catch(() => {
console.log("get tapd user error.");
})
}
if (project.zentaoId) {
this.hasZentaoId = true;
this.result = this.$get("/issues/zentao/builds/" + this.testCase.caseId, response => {
this.Builds = response.data;
this.result = this.$get("/issues/zentao/builds/" + this.testCase.caseId).then(response => {
this.Builds = response.data.data;
}).catch(() => {
console.log("get zentao builds error.");
})
this.result = this.$get("/issues/zentao/user/" + this.testCase.caseId, response => {
this.zentaoUsers = response.data;
this.result = this.$get("/issues/zentao/user/" + this.testCase.caseId).then(response => {
this.zentaoUsers = response.data.data;
}).catch(() => {
console.log("get zentao user error.");
})
}
})
@ -649,8 +655,10 @@ export default {
this.testCase.zentaoAssigned = "";
},
getIssues(caseId) {
this.result = this.$get("/issues/get/" + caseId, response => {
this.issues = response.data;
this.result = this.$get("/issues/get/" + caseId).then(response => {
this.issues = response.data.data;
}).catch(() => {
console.log("get issues error")
})
},
closeIssue(row) {

@ -1 +1 @@
Subproject commit d3c3ba983502dc9864db88645af392e36004f301
Subproject commit 06b31ddd4f2542cb86bf3e31a1a8f624742a2193

View File

@ -624,6 +624,7 @@ export default {
res_param: "Response content",
batch_delete: "Batch deletion",
delete_confirm: "Confirm deletion",
delete_case_confirm: "Confirm case deletion",
delete_confirm_step: "Confirm deletion step",
assertions_rule: "Assertion rule",
response_header: "Response header",

View File

@ -625,6 +625,7 @@ export default {
res_param: "响应内容",
batch_delete: "批量删除",
delete_confirm: "确认删除接口",
delete_case_confirm: "确认删除用例",
delete_confirm_step: "确认删除步骤",
assertions_rule: "断言规则",
response_header: "响应头",

View File

@ -624,6 +624,7 @@ export default {
res_param: "響應內容",
batch_delete: "批量刪除",
delete_confirm: "確認刪除接口",
delete_case_confirm: "確認刪除用例",
delete_confirm_step: "確認刪除步驟",
assertions_rule: "斷言規則",
response_header: "響應頭",