fix:【github】测试跟踪 新建用例关联接口测试
This commit is contained in:
parent
d4fec7b67d
commit
422aaf55b1
|
@ -1066,7 +1066,7 @@ public class TestCaseService {
|
||||||
TestCaseTest test = new TestCaseTest();
|
TestCaseTest test = new TestCaseTest();
|
||||||
selecteds.forEach(id -> {
|
selecteds.forEach(id -> {
|
||||||
test.setTestType(id.get(0));
|
test.setTestType(id.get(0));
|
||||||
test.setTestId(id.get(1));
|
test.setTestId(id.get(id.size() - 1));
|
||||||
test.setTestCaseId(request.getId());
|
test.setTestCaseId(request.getId());
|
||||||
test.setCreateTime(System.currentTimeMillis());
|
test.setCreateTime(System.currentTimeMillis());
|
||||||
test.setUpdateTime(System.currentTimeMillis());
|
test.setUpdateTime(System.currentTimeMillis());
|
||||||
|
@ -1113,7 +1113,7 @@ public class TestCaseService {
|
||||||
TestCaseTest test = new TestCaseTest();
|
TestCaseTest test = new TestCaseTest();
|
||||||
selecteds.forEach(id -> {
|
selecteds.forEach(id -> {
|
||||||
test.setTestType(id.get(0));
|
test.setTestType(id.get(0));
|
||||||
test.setTestId(id.get(1));
|
test.setTestId(id.get(id.size() - 1));
|
||||||
test.setCreateTime(System.currentTimeMillis());
|
test.setCreateTime(System.currentTimeMillis());
|
||||||
test.setUpdateTime(System.currentTimeMillis());
|
test.setUpdateTime(System.currentTimeMillis());
|
||||||
test.setTestCaseId(request.getId());
|
test.setTestCaseId(request.getId());
|
||||||
|
|
|
@ -524,6 +524,7 @@ public class TestPlanService {
|
||||||
if (StringUtils.equals(l.getTestType(), TestCaseStatus.automation.name())) {
|
if (StringUtils.equals(l.getTestType(), TestCaseStatus.automation.name())) {
|
||||||
TestPlanApiScenario t = new TestPlanApiScenario();
|
TestPlanApiScenario t = new TestPlanApiScenario();
|
||||||
ApiScenarioWithBLOBs testPlanApiScenario = apiScenarioMapper.selectByPrimaryKey(l.getTestId());
|
ApiScenarioWithBLOBs testPlanApiScenario = apiScenarioMapper.selectByPrimaryKey(l.getTestId());
|
||||||
|
if (testPlanApiScenario != null) {
|
||||||
t.setId(UUID.randomUUID().toString());
|
t.setId(UUID.randomUUID().toString());
|
||||||
t.setTestPlanId(request.getPlanId());
|
t.setTestPlanId(request.getPlanId());
|
||||||
t.setApiScenarioId(l.getTestId());
|
t.setApiScenarioId(l.getTestId());
|
||||||
|
@ -539,6 +540,8 @@ public class TestPlanService {
|
||||||
testPlanApiScenarioMapper.insert(t);
|
testPlanApiScenarioMapper.insert(t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,11 +15,12 @@
|
||||||
</span>
|
</span>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col v-else :span="7" style="margin-top: 10px;">
|
<el-col v-else :span="7" style="margin-top: 10px;">
|
||||||
<el-form-item :label="$t('test_track.case.relate_test')" :label-width="labelWidth">
|
<el-form-item :label="$t('test_track.case.relate_test')">
|
||||||
<el-cascader :options="sysList" filterable :placeholder="$t('test_track.case.please_select_relate_test')" show-all-levels
|
<el-cascader :options="sysList" filterable :placeholder="$t('test_track.case.please_select_relate_test')"
|
||||||
|
show-all-levels
|
||||||
v-model="form.selected" :props="props"
|
v-model="form.selected" :props="props"
|
||||||
:disabled="readOnly"
|
:disabled="readOnly"
|
||||||
class="ms-case" ref="cascade"></el-cascader>
|
ref="cascade"></el-cascader>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
@ -293,14 +294,48 @@ export default {
|
||||||
this.form.type = val;
|
this.form.type = val;
|
||||||
this.testOptions = [];
|
this.testOptions = [];
|
||||||
let url = '';
|
let url = '';
|
||||||
if (this.form.type === 'testcase' || this.form.type === 'automation') {
|
if (this.form.type === 'testcase') {
|
||||||
url = '/api/' + this.form.type + '/list/' + this.projectId;
|
url = '/api/' + this.form.type + '/list/' + this.projectId;
|
||||||
} else if (this.form.type === 'performance' || this.form.type === 'api') {
|
|
||||||
url = '/' + this.form.type + '/list/' + this.projectId;
|
|
||||||
}
|
|
||||||
if (!url) {
|
if (!url) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this.buildValue(url);
|
||||||
|
} else if (this.form.type === 'performance' || this.form.type === 'api') {
|
||||||
|
url = '/' + this.form.type + '/list/' + this.projectId;
|
||||||
|
if (!url) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.buildValue(url);
|
||||||
|
} else if (this.form.type === 'automation') {
|
||||||
|
//url = '/api/' + this.form.type + '/list/' + this.projectId;
|
||||||
|
url = '/api/automation/module/list/' + this.projectId;
|
||||||
|
if (!url) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.result.loading = true;
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
this.$get("/api/automation/module/list/" + this.projectId, response => {
|
||||||
|
if (response.data != undefined && response.data != null) {
|
||||||
|
this.buildTreeValue(response.data);
|
||||||
|
}
|
||||||
|
this.result.loading = false;
|
||||||
|
resolve(response.data);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
buildTreeValue(list) {
|
||||||
|
list.forEach(item => {
|
||||||
|
item.value = item.id,
|
||||||
|
item.label = item.name,
|
||||||
|
item.leaf = true;
|
||||||
|
if (item.children) {
|
||||||
|
this.buildTreeValue(item.children);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
buildValue(url) {
|
||||||
this.result.loading = true;
|
this.result.loading = true;
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.$get(url).then(res => {
|
this.$get(url).then(res => {
|
||||||
|
@ -315,7 +350,7 @@ export default {
|
||||||
reject(err);
|
reject(err);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -333,4 +368,9 @@ export default {
|
||||||
.remark-item {
|
.remark-item {
|
||||||
padding: 0px 15px;
|
padding: 0px 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.el-cascader >>> .el-input {
|
||||||
|
cursor: pointer;
|
||||||
|
width: 300px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue