Merge branch 'master' of https://github.com/metersphere/metersphere
This commit is contained in:
commit
4facb91b34
|
@ -39,4 +39,12 @@ public interface ExtTestPlanTestCaseMapper {
|
|||
List<TestPlanCaseDTO> listTestCaseByProjectIds(@Param("ids") List<String> ids);
|
||||
|
||||
TestPlanCaseDTO get(String testPlanTestCaseId);
|
||||
|
||||
/**
|
||||
* 获取测试计划下的 TestPlanTestCaseID 和 TestCaseName
|
||||
* @param request planId 不能为空
|
||||
* @return List<TestPlanCaseDTO>
|
||||
*/
|
||||
List<TestPlanCaseDTO> getTestPlanTestCaseList(@Param("request") QueryTestPlanCaseRequest request);
|
||||
|
||||
}
|
||||
|
|
|
@ -121,7 +121,9 @@
|
|||
</select>
|
||||
|
||||
<select id="list" resultType="io.metersphere.track.dto.TestPlanCaseDTO">
|
||||
select test_case.remark, test_plan_test_case.id as id, test_plan_test_case.*,test_case.*,test_case_node.name as model, project.name as projectName
|
||||
select test_plan_test_case.id as id, test_case.id as caseId, test_case.name, test_case.priority, test_case.type,
|
||||
test_case.node_path, test_case.method, test_case.num, test_plan_test_case.executor, test_plan_test_case.status,
|
||||
test_plan_test_case.update_time, test_case_node.name as model, project.name as projectName, test_plan_test_case.plan_id as planId
|
||||
from test_plan_test_case
|
||||
inner join test_case on test_plan_test_case.case_id = test_case.id
|
||||
left join test_case_node on test_case_node.id=test_case.node_id
|
||||
|
@ -134,7 +136,8 @@
|
|||
</include>
|
||||
</if>
|
||||
<if test="request.name != null">
|
||||
and (test_case.name like CONCAT('%', #{request.name},'%') or test_case.num like CONCAT('%', #{request.name},'%'))
|
||||
and (test_case.name like CONCAT('%', #{request.name},'%') or test_case.num like
|
||||
CONCAT('%',#{request.name},'%'))
|
||||
</if>
|
||||
<if test="request.id != null">
|
||||
and test_case.id = #{request.id}
|
||||
|
@ -210,6 +213,14 @@
|
|||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getTestPlanTestCaseList" resultType="io.metersphere.track.dto.TestPlanCaseDTO">
|
||||
select test_plan_test_case.id as id, test_case.name
|
||||
from test_plan_test_case
|
||||
inner join test_case on test_plan_test_case.case_id = test_case.id
|
||||
where test_plan_test_case.plan_id = #{request.planId}
|
||||
</select>
|
||||
|
||||
<select id="listTestCaseByProjectIds" resultType="io.metersphere.track.dto.TestPlanCaseDTO">
|
||||
select distinct * from test_plan_test_case, test_case
|
||||
where test_plan_test_case.case_id = test_case.id
|
||||
|
|
|
@ -785,7 +785,7 @@ public class JmeterDocumentParser implements DocumentParser {
|
|||
threadGroup.appendChild(createStringProp(document, "LogFilename", ""));
|
||||
// bzm - Concurrency Thread Group "Thread Iterations Limit:" 设置为空
|
||||
// threadGroup.appendChild(createStringProp(document, "Iterations", "1"));
|
||||
threadGroup.appendChild(createStringProp(document, "Unit", "M"));
|
||||
threadGroup.appendChild(createStringProp(document, "Unit", "S"));
|
||||
}
|
||||
|
||||
private void processCheckoutTimer(Element element) {
|
||||
|
@ -912,7 +912,7 @@ public class JmeterDocumentParser implements DocumentParser {
|
|||
} else {
|
||||
duration = (Integer) durations;
|
||||
}
|
||||
prop.getFirstChild().setNodeValue(String.valueOf(duration * 60));
|
||||
prop.getFirstChild().setNodeValue(String.valueOf(duration));
|
||||
continue;
|
||||
}
|
||||
Object rpsLimits = context.getProperty("rpsLimit");
|
||||
|
|
|
@ -83,6 +83,11 @@ public class TestPlanTestCaseController {
|
|||
return testPlanTestCaseService.list(request);
|
||||
}
|
||||
|
||||
@PostMapping("/list/ids")
|
||||
public List<TestPlanCaseDTO> getTestPlanCaseIds(@RequestBody QueryTestPlanCaseRequest request) {
|
||||
return testPlanTestCaseService.list(request);
|
||||
}
|
||||
|
||||
@PostMapping("/edit")
|
||||
@RequiresRoles(value = {RoleConstants.TEST_USER, RoleConstants.TEST_MANAGER}, logical = Logical.OR)
|
||||
public void editTestCase(@RequestBody TestPlanTestCaseWithBLOBs testPlanTestCase) {
|
||||
|
|
|
@ -473,26 +473,30 @@ export default {
|
|||
},
|
||||
getTestCase(index) {
|
||||
let testCase = this.testCases[index];
|
||||
let item = {};
|
||||
Object.assign(item, testCase);
|
||||
item.results = JSON.parse(item.results);
|
||||
item.steps = JSON.parse(item.steps);
|
||||
if (item.issues) {
|
||||
item.issues = JSON.parse(item.issues);
|
||||
} else {
|
||||
item.issues = {};
|
||||
item.issues.hasIssues = false;
|
||||
}
|
||||
item.steptResults = [];
|
||||
for (let i = 0; i < item.steps.length; i++) {
|
||||
if (item.results[i]) {
|
||||
item.steps[i].actualResult = item.results[i].actualResult;
|
||||
item.steps[i].executeResult = item.results[i].executeResult;
|
||||
// id 为 TestPlanTestCase 的 id
|
||||
this.result = this.$get('/test/plan/case/get/' + testCase.id, response => {
|
||||
let item = {};
|
||||
Object.assign(item, response.data);
|
||||
item.results = JSON.parse(item.results);
|
||||
item.steps = JSON.parse(item.steps);
|
||||
if (item.issues) {
|
||||
item.issues = JSON.parse(item.issues);
|
||||
} else {
|
||||
item.issues = {};
|
||||
}
|
||||
item.steptResults.push(item.steps[i]);
|
||||
}
|
||||
this.testCase = item;
|
||||
this.initTest();
|
||||
item.steptResults = [];
|
||||
for (let i = 0; i < item.steps.length; i++) {
|
||||
if (item.results[i]) {
|
||||
item.steps[i].actualResult = item.results[i].actualResult;
|
||||
item.steps[i].executeResult = item.results[i].executeResult;
|
||||
}
|
||||
item.steptResults.push(item.steps[i]);
|
||||
}
|
||||
this.testCase = item;
|
||||
this.getRelatedTest();
|
||||
this.initTest();
|
||||
})
|
||||
|
||||
this.getIssues(testCase.caseId);
|
||||
this.stepResultChange();
|
||||
this.getFileMetaData(testCase);
|
||||
|
@ -521,12 +525,13 @@ export default {
|
|||
},
|
||||
initTest() {
|
||||
this.$nextTick(() => {
|
||||
if (this.testCase.method === 'auto') {
|
||||
if (this.$refs.apiTestDetail && this.testCase.type === 'api') {
|
||||
|
||||
this.$refs.apiTestDetail.init();
|
||||
} else if (this.testCase.type === 'performance') {
|
||||
this.$refs.performanceTestDetail.init();
|
||||
if (this.testCase.testId && this.testCase.testId !== 'other') {
|
||||
if (this.testCase.method === 'auto') {
|
||||
if (this.$refs.apiTestDetail && this.testCase.type === 'api') {
|
||||
this.$refs.apiTestDetail.init();
|
||||
} else if (this.testCase.type === 'performance') {
|
||||
this.$refs.performanceTestDetail.init();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -546,13 +551,12 @@ export default {
|
|||
this.$post('/test/plan/case/edit', {id: this.testCase.id, reportId: reportId});
|
||||
},
|
||||
initData(testCase) {
|
||||
this.result = this.$post('/test/plan/case/list/all', this.searchParam, response => {
|
||||
this.result = this.$post('/test/plan/case/list/ids', this.searchParam, response => {
|
||||
this.testCases = response.data;
|
||||
for (let i = 0; i < this.testCases.length; i++) {
|
||||
if (this.testCases[i].id === testCase.id) {
|
||||
this.index = i;
|
||||
this.getTestCase(i);
|
||||
this.getRelatedTest();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue