fix(测试计划): 修复批量执行接口用例失败的问题

This commit is contained in:
shiziyuan9527 2021-04-02 15:26:53 +08:00 committed by BugKing
parent 0ed56a479e
commit 5c3f79d6ed
1 changed files with 2 additions and 1 deletions

View File

@ -509,13 +509,14 @@ export default {
}, },
batchRun(runData, reportId) { batchRun(runData, reportId) {
let testPlan = new TestPlan(); let testPlan = new TestPlan();
let projectId = this.$store.state.projectId;
let threadGroup = new ThreadGroup(); let threadGroup = new ThreadGroup();
threadGroup.hashTree = []; threadGroup.hashTree = [];
testPlan.hashTree = [threadGroup]; testPlan.hashTree = [threadGroup];
runData.forEach(item => { runData.forEach(item => {
threadGroup.hashTree.push(item); threadGroup.hashTree.push(item);
}); });
let reqObj = {id: reportId, testElement: testPlan, type: 'API_PLAN', reportId: "run"}; let reqObj = {id: reportId, testElement: testPlan, type: 'API_PLAN', reportId: "run", projectId: projectId};
let bodyFiles = getBodyUploadFiles(reqObj, runData); let bodyFiles = getBodyUploadFiles(reqObj, runData);
this.$fileUpload("/api/definition/run", null, bodyFiles, reqObj, response => { this.$fileUpload("/api/definition/run", null, bodyFiles, reqObj, response => {
}); });