Merge branch 'master' of github.com:metersphere/metersphere
This commit is contained in:
commit
6446024cf8
|
@ -174,7 +174,7 @@ public class MsJmeterParser extends ApiImportAbstractParser<ScenarioImport> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
samplerProxy.setPath(source.getPath());
|
samplerProxy.setPath("");
|
||||||
samplerProxy.setMethod(source.getMethod());
|
samplerProxy.setMethod(source.getMethod());
|
||||||
if (source.getUrl() != null) {
|
if (source.getUrl() != null) {
|
||||||
samplerProxy.setUrl(source.getUrl().toString());
|
samplerProxy.setUrl(source.getUrl().toString());
|
||||||
|
|
|
@ -137,7 +137,9 @@ public class MsHTTPSamplerProxy extends MsTestElement {
|
||||||
URL urlObject = new URL(url);
|
URL urlObject = new URL(url);
|
||||||
if (isUrl) {
|
if (isUrl) {
|
||||||
sampler.setDomain(URLDecoder.decode(urlObject.getHost(), "UTF-8"));
|
sampler.setDomain(URLDecoder.decode(urlObject.getHost(), "UTF-8"));
|
||||||
|
if (urlObject.getPort() > 0) {
|
||||||
sampler.setPort(urlObject.getPort());
|
sampler.setPort(urlObject.getPort());
|
||||||
|
}
|
||||||
sampler.setProtocol(urlObject.getProtocol());
|
sampler.setProtocol(urlObject.getProtocol());
|
||||||
} else {
|
} else {
|
||||||
sampler.setDomain(config.getConfig().get(this.getProjectId()).getHttpConfig().getDomain());
|
sampler.setDomain(config.getConfig().get(this.getProjectId()).getHttpConfig().getDomain());
|
||||||
|
|
|
@ -96,11 +96,13 @@ public class ApiAutomationService {
|
||||||
List<ApiScenarioDTO> list = extApiScenarioMapper.list(request);
|
List<ApiScenarioDTO> list = extApiScenarioMapper.list(request);
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ApiScenarioDTO> listReview(ApiScenarioRequest request) {
|
public List<ApiScenarioDTO> listReview(ApiScenarioRequest request) {
|
||||||
request = this.initRequest(request, true, true);
|
request = this.initRequest(request, true, true);
|
||||||
List<ApiScenarioDTO> list = extApiScenarioMapper.listReview(request);
|
List<ApiScenarioDTO> list = extApiScenarioMapper.listReview(request);
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setApiScenarioProjectIds(ApiScenarioDTO data) {
|
private void setApiScenarioProjectIds(ApiScenarioDTO data) {
|
||||||
// 如果场景步骤涉及多项目,则把涉及到的项目ID保存在projectIds属性
|
// 如果场景步骤涉及多项目,则把涉及到的项目ID保存在projectIds属性
|
||||||
List<String> idList = new ArrayList<>();
|
List<String> idList = new ArrayList<>();
|
||||||
|
@ -335,9 +337,10 @@ public class ApiAutomationService {
|
||||||
if (scenarioWithBLOBs != null) {
|
if (scenarioWithBLOBs != null) {
|
||||||
BeanUtils.copyBean(apiScenarioDTO, scenarioWithBLOBs);
|
BeanUtils.copyBean(apiScenarioDTO, scenarioWithBLOBs);
|
||||||
setApiScenarioProjectIds(apiScenarioDTO);
|
setApiScenarioProjectIds(apiScenarioDTO);
|
||||||
}
|
|
||||||
return apiScenarioDTO;
|
return apiScenarioDTO;
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public List<ApiScenarioWithBLOBs> getApiScenarios(List<String> ids) {
|
public List<ApiScenarioWithBLOBs> getApiScenarios(List<String> ids) {
|
||||||
if (CollectionUtils.isNotEmpty(ids)) {
|
if (CollectionUtils.isNotEmpty(ids)) {
|
||||||
|
@ -715,6 +718,7 @@ public class ApiAutomationService {
|
||||||
testPlanApiScenarioMapper.insert(testPlanApiScenario);
|
testPlanApiScenarioMapper.insert(testPlanApiScenario);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void relevanceReview(ApiCaseRelevanceRequest request) {
|
public void relevanceReview(ApiCaseRelevanceRequest request) {
|
||||||
Map<String, List<String>> mapping = request.getMapping();
|
Map<String, List<String>> mapping = request.getMapping();
|
||||||
Map<String, String> envMap = request.getEnvMap();
|
Map<String, String> envMap = request.getEnvMap();
|
||||||
|
@ -741,6 +745,7 @@ public class ApiAutomationService {
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ApiScenario> selectByIds(List<String> ids) {
|
public List<ApiScenario> selectByIds(List<String> ids) {
|
||||||
ApiScenarioExample example = new ApiScenarioExample();
|
ApiScenarioExample example = new ApiScenarioExample();
|
||||||
example.createCriteria().andIdIn(ids);
|
example.createCriteria().andIdIn(ids);
|
||||||
|
|
|
@ -161,12 +161,12 @@
|
||||||
#{value}
|
#{value}
|
||||||
</foreach>
|
</foreach>
|
||||||
</when>
|
</when>
|
||||||
<otherwise>
|
<when test="key=='status'">
|
||||||
and test_case_review_test_case.status in
|
and test_case.review_status in
|
||||||
<foreach collection="values" item="value" separator="," open="(" close=")">
|
<foreach collection="values" item="value" separator="," open="(" close=")">
|
||||||
#{value}
|
#{value}
|
||||||
</foreach>
|
</foreach>
|
||||||
</otherwise>
|
</when>
|
||||||
</choose>
|
</choose>
|
||||||
</if>
|
</if>
|
||||||
</foreach>
|
</foreach>
|
||||||
|
|
|
@ -551,8 +551,8 @@ public class TestPlanService {
|
||||||
queryTestPlanRequest.setId(planId);
|
queryTestPlanRequest.setId(planId);
|
||||||
|
|
||||||
TestPlanDTO testPlan = extTestPlanMapper.list(queryTestPlanRequest).get(0);
|
TestPlanDTO testPlan = extTestPlanMapper.list(queryTestPlanRequest).get(0);
|
||||||
String projectName = getProjectNameByPlanId(planId);
|
Project project = projectMapper.selectByPrimaryKey(testPlan.getProjectId());
|
||||||
testPlan.setProjectName(projectName);
|
testPlan.setProjectName(project.getName());
|
||||||
|
|
||||||
TestCaseReport testCaseReport = testCaseReportMapper.selectByPrimaryKey(testPlan.getReportId());
|
TestCaseReport testCaseReport = testCaseReportMapper.selectByPrimaryKey(testPlan.getReportId());
|
||||||
JSONObject content = JSONObject.parseObject(testCaseReport.getContent());
|
JSONObject content = JSONObject.parseObject(testCaseReport.getContent());
|
||||||
|
@ -708,8 +708,8 @@ public class TestPlanService {
|
||||||
queryTestPlanRequest.setId(planId);
|
queryTestPlanRequest.setId(planId);
|
||||||
|
|
||||||
TestPlanDTO testPlan = extTestPlanMapper.list(queryTestPlanRequest).get(0);
|
TestPlanDTO testPlan = extTestPlanMapper.list(queryTestPlanRequest).get(0);
|
||||||
String projectName = getProjectNameByPlanId(planId);
|
Project project = projectMapper.selectByPrimaryKey(testPlan.getProjectId());
|
||||||
testPlan.setProjectName(projectName);
|
testPlan.setProjectName(project.getName());
|
||||||
|
|
||||||
TestCaseReport testCaseReport = testCaseReportMapper.selectByPrimaryKey(testPlan.getReportId());
|
TestCaseReport testCaseReport = testCaseReportMapper.selectByPrimaryKey(testPlan.getReportId());
|
||||||
JSONObject content = JSONObject.parseObject(testCaseReport.getContent());
|
JSONObject content = JSONObject.parseObject(testCaseReport.getContent());
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit efd6af73b7c5cc53cd4515772000bc1436c49837
|
Subproject commit 245845e07bf3fe2f60311eeb78f8f109301a2d39
|
|
@ -159,6 +159,10 @@ export default {
|
||||||
},
|
},
|
||||||
handleView(report) {
|
handleView(report) {
|
||||||
this.reportId = report.id;
|
this.reportId = report.id;
|
||||||
|
if(report.status ==='Running'){
|
||||||
|
this.$warning("正在运行中,请稍后查看")
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.currentProjectId = report.projectId;
|
this.currentProjectId = report.projectId;
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: 'report/view/' + report.id,
|
path: 'report/view/' + report.id,
|
||||||
|
|
|
@ -202,7 +202,7 @@
|
||||||
new URL(url);
|
new URL(url);
|
||||||
this.request.url = url;
|
this.request.url = url;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (url) {
|
if (url && (!url.startsWith("http://") || !url.startsWith("https://"))) {
|
||||||
this.request.path = url;
|
this.request.path = url;
|
||||||
this.request.url = undefined;
|
this.request.url = undefined;
|
||||||
}
|
}
|
||||||
|
|
|
@ -194,7 +194,7 @@
|
||||||
this.$emit('batchEditCase');
|
this.$emit('batchEditCase');
|
||||||
},
|
},
|
||||||
deleteCase(index, row) {
|
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'),
|
confirmButtonText: this.$t('commons.confirm'),
|
||||||
callback: (action) => {
|
callback: (action) => {
|
||||||
if (action === 'confirm') {
|
if (action === 'confirm') {
|
||||||
|
@ -305,10 +305,6 @@
|
||||||
row.id = data.id;
|
row.id = data.id;
|
||||||
row.createTime = data.createTime;
|
row.createTime = data.createTime;
|
||||||
row.updateTime = data.updateTime;
|
row.updateTime = data.updateTime;
|
||||||
if (!row.message) {
|
|
||||||
this.$success(this.$t('commons.save_success'));
|
|
||||||
this.$emit('refresh');
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
saveTestCase(row) {
|
saveTestCase(row) {
|
||||||
|
@ -317,7 +313,6 @@
|
||||||
} else {
|
} else {
|
||||||
this.saveCase(row);
|
this.saveCase(row);
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
showInput(row) {
|
showInput(row) {
|
||||||
// row.type = "create";
|
// row.type = "create";
|
||||||
|
|
|
@ -94,8 +94,8 @@
|
||||||
<span class="default-property">
|
<span class="default-property">
|
||||||
未通过
|
未通过
|
||||||
{{"\xa0\xa0"}}
|
{{"\xa0\xa0"}}
|
||||||
<el-link type="info" @click="redirectPage('Pass')" target="_blank" style="color: #000000">
|
<el-link type="info" @click="redirectPage('UnPass')" target="_blank" style="color: #000000">
|
||||||
{{trackCountData.passCount}}
|
{{trackCountData.unPassCount}}
|
||||||
</el-link>
|
</el-link>
|
||||||
</span>
|
</span>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -103,8 +103,8 @@
|
||||||
<span class="main-property">
|
<span class="main-property">
|
||||||
已通过
|
已通过
|
||||||
{{"\xa0\xa0"}}
|
{{"\xa0\xa0"}}
|
||||||
<el-link type="info" @click="redirectPage('UnPass')" target="_blank" style="color: #000000">
|
<el-link type="info" @click="redirectPage('Pass')" target="_blank" style="color: #000000">
|
||||||
{{trackCountData.unPassCount}}
|
{{trackCountData.passCount}}
|
||||||
</el-link>
|
</el-link>
|
||||||
</span>
|
</span>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
import MsDialogFooter from '../../../../../common/components/MsDialogFooter'
|
import MsDialogFooter from '../../../../../common/components/MsDialogFooter'
|
||||||
import SelectMenu from "../../../../common/SelectMenu";
|
import SelectMenu from "../../../../common/SelectMenu";
|
||||||
import RelevanceDialog from "./RelevanceDialog";
|
import RelevanceDialog from "./RelevanceDialog";
|
||||||
|
import {getCurrentProjectID} from "@/common/js/utils";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "TestCaseRelevanceBase",
|
name: "TestCaseRelevanceBase",
|
||||||
|
@ -93,11 +94,18 @@
|
||||||
this.result = this.$get("/project/listAll", res => {
|
this.result = this.$get("/project/listAll", res => {
|
||||||
let data = res.data;
|
let data = res.data;
|
||||||
if (data) {
|
if (data) {
|
||||||
|
const index = data.findIndex(d => d.id === getCurrentProjectID());
|
||||||
this.projects = data;
|
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.projectId = data[0].id;
|
||||||
this.projectName = data[0].name;
|
this.projectName = data[0].name;
|
||||||
this.changeProject(data[0]);
|
this.changeProject(data[0]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -591,17 +591,23 @@ export default {
|
||||||
const project = res.data;
|
const project = res.data;
|
||||||
if (project.tapdId) {
|
if (project.tapdId) {
|
||||||
this.hasTapdId = true;
|
this.hasTapdId = true;
|
||||||
this.result = this.$get("/issues/tapd/user/" + this.testCase.caseId, response => {
|
this.result = this.$get("/issues/tapd/user/" + this.testCase.caseId).then(response => {
|
||||||
this.users = response.data;
|
this.users = response.data.data;
|
||||||
|
}).catch(() => {
|
||||||
|
console.log("get tapd user error.");
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (project.zentaoId) {
|
if (project.zentaoId) {
|
||||||
this.hasZentaoId = true;
|
this.hasZentaoId = true;
|
||||||
this.result = this.$get("/issues/zentao/builds/" + this.testCase.caseId, response => {
|
this.result = this.$get("/issues/zentao/builds/" + this.testCase.caseId).then(response => {
|
||||||
this.Builds = response.data;
|
this.Builds = response.data.data;
|
||||||
|
}).catch(() => {
|
||||||
|
console.log("get zentao builds error.");
|
||||||
})
|
})
|
||||||
this.result = this.$get("/issues/zentao/user/" + this.testCase.caseId, response => {
|
this.result = this.$get("/issues/zentao/user/" + this.testCase.caseId).then(response => {
|
||||||
this.zentaoUsers = response.data;
|
this.zentaoUsers = response.data.data;
|
||||||
|
}).catch(() => {
|
||||||
|
console.log("get zentao user error.");
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -649,8 +655,10 @@ export default {
|
||||||
this.testCase.zentaoAssigned = "";
|
this.testCase.zentaoAssigned = "";
|
||||||
},
|
},
|
||||||
getIssues(caseId) {
|
getIssues(caseId) {
|
||||||
this.result = this.$get("/issues/get/" + caseId, response => {
|
this.result = this.$get("/issues/get/" + caseId).then(response => {
|
||||||
this.issues = response.data;
|
this.issues = response.data.data;
|
||||||
|
}).catch(() => {
|
||||||
|
console.log("get issues error")
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
closeIssue(row) {
|
closeIssue(row) {
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit d3c3ba983502dc9864db88645af392e36004f301
|
Subproject commit 06b31ddd4f2542cb86bf3e31a1a8f624742a2193
|
|
@ -624,6 +624,7 @@ export default {
|
||||||
res_param: "Response content",
|
res_param: "Response content",
|
||||||
batch_delete: "Batch deletion",
|
batch_delete: "Batch deletion",
|
||||||
delete_confirm: "Confirm deletion",
|
delete_confirm: "Confirm deletion",
|
||||||
|
delete_case_confirm: "Confirm case deletion",
|
||||||
delete_confirm_step: "Confirm deletion step",
|
delete_confirm_step: "Confirm deletion step",
|
||||||
assertions_rule: "Assertion rule",
|
assertions_rule: "Assertion rule",
|
||||||
response_header: "Response header",
|
response_header: "Response header",
|
||||||
|
|
|
@ -625,6 +625,7 @@ export default {
|
||||||
res_param: "响应内容",
|
res_param: "响应内容",
|
||||||
batch_delete: "批量删除",
|
batch_delete: "批量删除",
|
||||||
delete_confirm: "确认删除接口",
|
delete_confirm: "确认删除接口",
|
||||||
|
delete_case_confirm: "确认删除用例",
|
||||||
delete_confirm_step: "确认删除步骤",
|
delete_confirm_step: "确认删除步骤",
|
||||||
assertions_rule: "断言规则",
|
assertions_rule: "断言规则",
|
||||||
response_header: "响应头",
|
response_header: "响应头",
|
||||||
|
|
|
@ -624,6 +624,7 @@ export default {
|
||||||
res_param: "響應內容",
|
res_param: "響應內容",
|
||||||
batch_delete: "批量刪除",
|
batch_delete: "批量刪除",
|
||||||
delete_confirm: "確認刪除接口",
|
delete_confirm: "確認刪除接口",
|
||||||
|
delete_case_confirm: "確認刪除用例",
|
||||||
delete_confirm_step: "確認刪除步驟",
|
delete_confirm_step: "確認刪除步驟",
|
||||||
assertions_rule: "斷言規則",
|
assertions_rule: "斷言規則",
|
||||||
response_header: "響應頭",
|
response_header: "響應頭",
|
||||||
|
|
Loading…
Reference in New Issue