Merge branch 'master' of https://github.com/metersphere/metersphere
This commit is contained in:
commit
d8dd87f356
|
@ -4,6 +4,8 @@ import io.metersphere.base.domain.TestCaseWithBLOBs;
|
|||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class TestReviewCaseDTO extends TestCaseWithBLOBs {
|
||||
|
@ -16,4 +18,5 @@ public class TestReviewCaseDTO extends TestCaseWithBLOBs {
|
|||
private String issues;
|
||||
private String model;
|
||||
private String projectName;
|
||||
private List<TestCaseTestDTO> list;
|
||||
}
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
package io.metersphere.track.service;
|
||||
|
||||
import io.metersphere.base.domain.*;
|
||||
import io.metersphere.base.mapper.TestCaseMapper;
|
||||
import io.metersphere.base.mapper.TestCaseReviewMapper;
|
||||
import io.metersphere.base.mapper.TestCaseReviewTestCaseMapper;
|
||||
import io.metersphere.base.mapper.TestCaseReviewUsersMapper;
|
||||
import io.metersphere.base.mapper.*;
|
||||
import io.metersphere.base.mapper.ext.ExtTestPlanTestCaseMapper;
|
||||
import io.metersphere.base.mapper.ext.ExtTestReviewCaseMapper;
|
||||
import io.metersphere.commons.exception.MSException;
|
||||
import io.metersphere.commons.utils.ServiceUtils;
|
||||
import io.metersphere.commons.utils.SessionUtils;
|
||||
import io.metersphere.controller.request.member.QueryMemberRequest;
|
||||
import io.metersphere.service.UserService;
|
||||
import io.metersphere.track.dto.TestCaseTestDTO;
|
||||
import io.metersphere.track.dto.TestPlanCaseDTO;
|
||||
import io.metersphere.track.dto.TestReviewCaseDTO;
|
||||
import io.metersphere.track.request.testplancase.TestReviewCaseBatchRequest;
|
||||
import io.metersphere.track.request.testreview.DeleteRelevanceRequest;
|
||||
|
@ -29,7 +29,14 @@ import java.util.stream.Collectors;
|
|||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class TestReviewTestCaseService {
|
||||
|
||||
@Resource
|
||||
private TestCaseTestMapper testCaseTestMapper;
|
||||
@Resource
|
||||
private LoadTestMapper loadTestMapper;
|
||||
@Resource
|
||||
private ApiTestCaseMapper apiTestCaseMapper;
|
||||
@Resource
|
||||
private ApiScenarioMapper apiScenarioMapper;
|
||||
@Resource
|
||||
ExtTestReviewCaseMapper extTestReviewCaseMapper;
|
||||
@Resource
|
||||
|
@ -44,6 +51,8 @@ public class TestReviewTestCaseService {
|
|||
TestCaseReviewService testCaseReviewService;
|
||||
@Resource
|
||||
TestCaseMapper testCaseMapper;
|
||||
@Resource
|
||||
ExtTestPlanTestCaseMapper extTestPlanTestCaseMapper;
|
||||
|
||||
public List<TestReviewCaseDTO> list(QueryCaseReviewRequest request) {
|
||||
request.setOrders(ServiceUtils.getDefaultOrder(request.getOrders()));
|
||||
|
@ -128,7 +137,40 @@ public class TestReviewTestCaseService {
|
|||
}
|
||||
|
||||
public TestReviewCaseDTO get(String reviewId) {
|
||||
return extTestReviewCaseMapper.get(reviewId);
|
||||
TestReviewCaseDTO testReviewCaseDTO=extTestReviewCaseMapper.get(reviewId);
|
||||
List<TestCaseTestDTO> testCaseTestDTOS = extTestPlanTestCaseMapper.listTestCaseTest(testReviewCaseDTO.getCaseId());
|
||||
testCaseTestDTOS.forEach(dto -> {
|
||||
setTestName(dto);
|
||||
});
|
||||
testReviewCaseDTO.setList(testCaseTestDTOS);
|
||||
return testReviewCaseDTO;
|
||||
}
|
||||
|
||||
private void setTestName(TestCaseTestDTO dto) {
|
||||
String type = dto.getTestType();
|
||||
String id = dto.getTestId();
|
||||
switch (type) {
|
||||
case "performance":
|
||||
LoadTest loadTest = loadTestMapper.selectByPrimaryKey(id);
|
||||
if (loadTest != null) {
|
||||
dto.setTestName(loadTest.getName());
|
||||
}
|
||||
break;
|
||||
case "testcase":
|
||||
ApiTestCaseWithBLOBs apiTestCaseWithBLOBs = apiTestCaseMapper.selectByPrimaryKey(id);
|
||||
if (apiTestCaseWithBLOBs != null) {
|
||||
dto.setTestName(apiTestCaseWithBLOBs.getName());
|
||||
}
|
||||
break;
|
||||
case "automation":
|
||||
ApiScenarioWithBLOBs apiScenarioWithBLOBs = apiScenarioMapper.selectByPrimaryKey(id);
|
||||
if (apiScenarioWithBLOBs != null) {
|
||||
dto.setTestName(apiScenarioWithBLOBs.getName());
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void editTestCaseBatchStatus(TestReviewCaseBatchRequest request) {
|
||||
|
|
|
@ -244,7 +244,7 @@
|
|||
return {
|
||||
type: API_SCENARIO_LIST,
|
||||
headerItems: Api_Scenario_List,
|
||||
tableLabel: [],
|
||||
tableLabel: Api_Scenario_List,
|
||||
loading: false,
|
||||
screenHeight: document.documentElement.clientHeight - 280,//屏幕高度,
|
||||
condition: {
|
||||
|
@ -419,6 +419,9 @@
|
|||
});
|
||||
this.loading = false;
|
||||
this.unSelection = data.listObject.map(s => s.id);
|
||||
if (this.$refs.scenarioTable) {
|
||||
this.$refs.scenarioTable.doLayout()
|
||||
}
|
||||
});
|
||||
}
|
||||
getLabel(this, API_SCENARIO_LIST);
|
||||
|
|
|
@ -186,7 +186,7 @@ export default {
|
|||
return {
|
||||
type: API_CASE_LIST,
|
||||
headerItems: Api_Case_List,
|
||||
tableLabel: [],
|
||||
tableLabel: Api_Case_List,
|
||||
condition: {
|
||||
components: API_CASE_CONFIGS
|
||||
},
|
||||
|
@ -260,6 +260,10 @@ export default {
|
|||
},
|
||||
created: function () {
|
||||
this.initTable();
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.$refs.caseTable.bodyWrapper.scrollTop = 5
|
||||
})
|
||||
},
|
||||
watch: {
|
||||
selectNodeIds() {
|
||||
|
@ -277,24 +281,24 @@ export default {
|
|||
this.initTable();
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
computed: {
|
||||
|
||||
// 接口定义用例列表
|
||||
isApiModel() {
|
||||
return this.model === 'api'
|
||||
},
|
||||
// 接口定义用例列表
|
||||
isApiModel() {
|
||||
return this.model === 'api'
|
||||
},
|
||||
methods: {
|
||||
customHeader() {
|
||||
getLabel(this, API_CASE_LIST);
|
||||
this.$refs.headerCustom.open(this.tableLabel)
|
||||
},
|
||||
initTable() {
|
||||
},
|
||||
methods: {
|
||||
customHeader() {
|
||||
getLabel(this, API_CASE_LIST);
|
||||
this.$refs.headerCustom.open(this.tableLabel)
|
||||
},
|
||||
initTable() {
|
||||
|
||||
this.selectRows = new Set();
|
||||
this.condition.status = "";
|
||||
this.condition.moduleIds = this.selectNodeIds;
|
||||
if (this.trashEnable) {
|
||||
this.selectRows = new Set();
|
||||
this.condition.status = "";
|
||||
this.condition.moduleIds = this.selectNodeIds;
|
||||
if (this.trashEnable) {
|
||||
this.condition.status = "Trash";
|
||||
this.condition.moduleIds = [];
|
||||
}
|
||||
|
@ -331,9 +335,13 @@ export default {
|
|||
item.tags = JSON.parse(item.tags);
|
||||
}
|
||||
})
|
||||
if (this.$refs.caseTable) {
|
||||
this.$refs.caseTable.doLayout()
|
||||
}
|
||||
});
|
||||
}
|
||||
getLabel(this, API_CASE_LIST);
|
||||
|
||||
},
|
||||
open() {
|
||||
this.$refs.searchBar.open();
|
||||
|
@ -636,4 +644,7 @@ export default {
|
|||
top: -2px;
|
||||
}
|
||||
|
||||
/deep/ .el-table__fixed {
|
||||
height: 100% !important;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -272,7 +272,7 @@
|
|||
return {
|
||||
type: API_LIST,
|
||||
headerItems: Api_List,
|
||||
tableLabel: [],
|
||||
tableLabel: Api_List,
|
||||
condition: {
|
||||
components: API_DEFINITION_CONFIGS
|
||||
},
|
||||
|
@ -442,6 +442,10 @@
|
|||
item.tags = JSON.parse(item.tags);
|
||||
}
|
||||
})
|
||||
if (this.$refs.apiDefinitionTable) {
|
||||
this.$refs.apiDefinitionTable.doLayout()
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
getLabel(this, API_LIST);
|
||||
|
|
|
@ -47,18 +47,14 @@ export default {
|
|||
},
|
||||
open(items) {
|
||||
this.defaultCheckedKeys = []
|
||||
|
||||
this.dialogTableVisible = true
|
||||
this.fieldSelected = items
|
||||
if (items.size <= 0) {
|
||||
this.optionalField = this.optionalFields
|
||||
} else {
|
||||
items.forEach(i => {
|
||||
this.defaultCheckedKeys.push(i.id)
|
||||
}
|
||||
)
|
||||
}
|
||||
items.forEach(i => {
|
||||
this.defaultCheckedKeys.push(i.id)
|
||||
}
|
||||
)
|
||||
console.log(this.defaultCheckedKeys)
|
||||
console.log(this.optionalFields)
|
||||
console.log(this.fieldSelected)
|
||||
|
||||
},
|
||||
saveHeader() {
|
||||
|
@ -83,7 +79,6 @@ export default {
|
|||
},
|
||||
|
||||
|
||||
|
||||
// 切换模式 现有树形穿梭框模式transfer 和通讯录模式addressList
|
||||
// changeMode() {
|
||||
// if (this.mode == "transfer") {
|
||||
|
|
|
@ -105,13 +105,12 @@ export default {
|
|||
this.testCaseForm.projectId = getCurrentProjectID();
|
||||
this.testCaseForm.type = "";
|
||||
this.testCaseForm.priority = "P0";
|
||||
this.testCaseForm.method = "manual";
|
||||
if(this.currentModule!==undefined){
|
||||
if (this.currentModule !== undefined || this.currentModule !== null || this.currentModule !== 0 || this.currentModule !== "") {
|
||||
this.testCaseForm.nodePath = this.currentModule.path;
|
||||
this.testCaseForm.nodeId = this.currentModule.id;
|
||||
}else{
|
||||
this.testCaseForm.nodePath="/全部用例"
|
||||
this.testCaseForm.nodeId="root"
|
||||
} else {
|
||||
this.testCaseForm.nodePath = "/全部用例"
|
||||
this.testCaseForm.nodeId = "root"
|
||||
}
|
||||
this.result = this.$post(path, this.testCaseForm, response => {
|
||||
this.testCaseForm.id=response.data.id
|
||||
|
|
|
@ -97,17 +97,12 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-form-item :label="$t('test_track.case.relate_test')" :label-width="formLabelWidth" prop="testId">
|
||||
<el-cascader show-all-levels v-model="form.selected" :props="props" ></el-cascader>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="7" v-if="form.testId=='other'">
|
||||
<el-form-item :label="$t('test_track.case.test_name')" :label-width="formLabelWidth" prop="testId">
|
||||
<el-input v-model="form.otherTestName" :placeholder="$t('test_track.case.input_test_case')"></el-input>
|
||||
<el-col :span="14">
|
||||
<el-form-item :label="$t('test_track.case.relate_test')" :label-width="formLabelWidth">
|
||||
<el-cascader filterable placeholder="请选择要关联的测试" show-all-levels v-model="form.selected" :props="props"
|
||||
class="ms-case"></el-cascader>
|
||||
</el-form-item>
|
||||
</el-col>-->
|
||||
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
@ -125,8 +120,9 @@
|
|||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="需求名称" :label-width="formLabelWidth" prop="demandName" v-if="form.demandId=='other'">
|
||||
<el-col :span="10" :offset="1">
|
||||
<el-form-item label="需求ID/名称" :label-width="formLabelWidth" prop="demandName"
|
||||
v-if="form.demandId=='other'">
|
||||
<el-input v-model="form.demandName"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
@ -340,7 +336,6 @@ export default {
|
|||
}
|
||||
if (this.projectId && this.form.type != '' && this.form.type != 'undefined') {
|
||||
this.$get(url, response => {
|
||||
response.data.unshift({id: 'other', name: this.$t('test_track.case.other')})
|
||||
const nodes = response.data
|
||||
.map(item => ({
|
||||
value: item.id,
|
||||
|
@ -581,8 +576,10 @@ export default {
|
|||
}
|
||||
Object.assign(this.form, tmp);
|
||||
this.form.module = testCase.nodeId;
|
||||
this.form.testId=testCase.selected
|
||||
console.log(this.form.testId)
|
||||
/*
|
||||
this.form.testId=testCase.selected
|
||||
*/
|
||||
console.log(this.form.selected)
|
||||
this.getFileMetaData(testCase);
|
||||
},
|
||||
setTestCaseExtInfo(testCase) {
|
||||
|
@ -778,7 +775,6 @@ export default {
|
|||
});
|
||||
},
|
||||
getTestOptions(val) {
|
||||
console.log(val)
|
||||
this.projectId = getCurrentProjectID()
|
||||
this.testOptions = [];
|
||||
let url = '';
|
||||
|
@ -998,6 +994,10 @@ export default {
|
|||
width: 100%;
|
||||
}
|
||||
|
||||
.ms-case {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/deep/ .el-button-group > .el-button:first-child {
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
|
|
|
@ -29,6 +29,7 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
open(file) {
|
||||
console.log(file)
|
||||
this.file = file;
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
|
|
|
@ -259,7 +259,7 @@ export default {
|
|||
return {
|
||||
type: TEST_CASE_LIST,
|
||||
headerItems: Track_Test_Case,
|
||||
tableLabel: [],
|
||||
tableLabel: Track_Test_Case,
|
||||
result: {},
|
||||
deletePath: "/test/case/delete",
|
||||
condition: {
|
||||
|
@ -443,6 +443,10 @@ export default {
|
|||
item.tags = JSON.parse(item.tags);
|
||||
}
|
||||
})
|
||||
if (this.$refs.table) {
|
||||
this.$refs.table.doLayout()
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
},
|
||||
|
|
|
@ -248,7 +248,7 @@ export default {
|
|||
return {
|
||||
type: TEST_PLAN_LIST,
|
||||
headerItems: Test_Plan_List,
|
||||
tableLabel: [],
|
||||
tableLabel: Test_Plan_List,
|
||||
result: {},
|
||||
enableDeleteTip: false,
|
||||
queryPath: "/test/plan/list",
|
||||
|
|
|
@ -192,7 +192,7 @@ export default {
|
|||
return {
|
||||
type: TEST_PLAN_API_CASE,
|
||||
headerItems: Test_Plan_Api_Case,
|
||||
tableLabel: [],
|
||||
tableLabel: Test_Plan_Api_Case,
|
||||
condition: {},
|
||||
selectCase: {},
|
||||
result: {},
|
||||
|
|
|
@ -148,7 +148,7 @@ export default {
|
|||
return {
|
||||
type: TEST_PLAN_SCENARIO_CASE,
|
||||
headerItems: Test_Plan_Scenario_Case,
|
||||
tableLabel: [],
|
||||
tableLabel: Test_Plan_Scenario_Case,
|
||||
loading: false,
|
||||
condition: {},
|
||||
currentScenario: {},
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
:select-ids="new Set(Array.from(this.selectRows).map(row => row.id))" @refresh="initTableData"/>
|
||||
|
||||
<el-table
|
||||
ref="table"
|
||||
class="adjust-table"
|
||||
border
|
||||
@select-all="handleSelectAll"
|
||||
|
@ -328,7 +329,7 @@ export default {
|
|||
return {
|
||||
type: TEST_PLAN_FUNCTION_TEST_CASE,
|
||||
headerItems: Test_Plan_Function_Test_Case,
|
||||
tableLabel: [],
|
||||
tableLabel: Test_Plan_Function_Test_Case,
|
||||
result: {},
|
||||
deletePath: "/test/case/delete",
|
||||
condition: {
|
||||
|
@ -479,6 +480,9 @@ export default {
|
|||
}
|
||||
}
|
||||
this.selectRows.clear();
|
||||
if (this.$refs.table) {
|
||||
this.$refs.table.doLayout()
|
||||
}
|
||||
});
|
||||
}
|
||||
getLabel(this, TEST_PLAN_FUNCTION_TEST_CASE);
|
||||
|
|
|
@ -154,7 +154,7 @@ export default {
|
|||
return {
|
||||
type: TEST_PLAN_LOAD_CASE,
|
||||
headerItems: Test_Plan_Load_Case,
|
||||
tableLabel: [],
|
||||
tableLabel: Test_Plan_Load_Case,
|
||||
condition: {},
|
||||
result: {},
|
||||
tableData: [],
|
||||
|
|
|
@ -74,8 +74,12 @@
|
|||
</el-row>
|
||||
<el-row>
|
||||
<el-col :offset="1">
|
||||
<span class="cast_label">{{ $t('test_track.plan_view.relevance_test_case') }}:</span>
|
||||
<span class="cast_item">{{ testCase.prerequisite }}</span>
|
||||
<span class="cast_label">关联测试:</span>
|
||||
<span v-for="(item,index) in testCase.list" :key="index">
|
||||
<el-button @click="openTest(item)" type="text" style="margin-left: 7px;">{{
|
||||
item.testName
|
||||
}}</el-button>
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
|
@ -241,7 +245,7 @@ import PerformanceTestDetail from "../../../plan/view/comonents/test/Performance
|
|||
import ApiTestResult from "../../../plan/view/comonents/test/ApiTestResult";
|
||||
import ApiTestDetail from "../../../plan/view/comonents/test/ApiTestDetail";
|
||||
import TestPlanTestCaseStatusButton from "../../../plan/common/TestPlanTestCaseStatusButton";
|
||||
import {getCurrentProjectID, listenGoBack, removeGoBackListener} from "@/common/js/utils";
|
||||
import {getCurrentProjectID, getUUID, listenGoBack, removeGoBackListener} from "@/common/js/utils";
|
||||
import ReviewComment from "../../commom/ReviewComment";
|
||||
import TestCaseAttachment from "@/business/components/track/case/components/TestCaseAttachment";
|
||||
import ApiCaseItem from "@/business/components/api/definition/components/case/ApiCaseItem";
|
||||
|
@ -295,6 +299,35 @@ export default {
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
openTest(item) {
|
||||
const type = item.testType;
|
||||
const id = item.testId;
|
||||
switch (type) {
|
||||
case "performance": {
|
||||
let performanceData = this.$router.resolve({
|
||||
path: '/performance/test/edit/' + id,
|
||||
})
|
||||
window.open(performanceData.href, '_blank');
|
||||
break;
|
||||
}
|
||||
case "testcase": {
|
||||
let caseData = this.$router.resolve({
|
||||
name: 'ApiDefinition',
|
||||
params: {redirectID: getUUID(), dataType: "apiTestCase", dataSelectRange: 'single:' + id}
|
||||
});
|
||||
window.open(caseData.href, '_blank');
|
||||
break;
|
||||
}
|
||||
case "automation": {
|
||||
let automationData = this.$router.resolve({
|
||||
name: 'ApiAutomation',
|
||||
params: {redirectID: getUUID(), dataType: "scenario", dataSelectRange: 'edit:' + id}
|
||||
});
|
||||
window.open(automationData.href, '_blank');
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
handleClose() {
|
||||
removeGoBackListener(this.handleClose);
|
||||
this.showDialog = false;
|
||||
|
@ -354,6 +387,7 @@ export default {
|
|||
item.steptResults.push(item.steps[i]);
|
||||
}
|
||||
this.testCase = item;
|
||||
console.log(this.testCase)
|
||||
this.getRelatedTest();
|
||||
this.getComments(item);
|
||||
/* this.initTest();*/
|
||||
|
|
Loading…
Reference in New Issue