Merge branch 'master' of https://github.com/metersphere/metersphere
This commit is contained in:
commit
a2ff38a10f
|
@ -5,6 +5,7 @@ import com.github.pagehelper.PageHelper;
|
|||
import io.metersphere.api.dto.ApiCaseBatchRequest;
|
||||
import io.metersphere.api.dto.definition.*;
|
||||
import io.metersphere.api.service.ApiTestCaseService;
|
||||
import io.metersphere.base.domain.ApiTestCase;
|
||||
import io.metersphere.base.domain.ApiTestCaseWithBLOBs;
|
||||
import io.metersphere.commons.constants.RoleConstants;
|
||||
import io.metersphere.commons.utils.PageUtils;
|
||||
|
@ -61,13 +62,13 @@ public class ApiTestCaseController {
|
|||
}
|
||||
|
||||
@PostMapping(value = "/create", consumes = {"multipart/form-data"})
|
||||
public void create(@RequestPart("request") SaveApiTestCaseRequest request, @RequestPart(value = "files") List<MultipartFile> bodyFiles) {
|
||||
apiTestCaseService.create(request, bodyFiles);
|
||||
public ApiTestCase create(@RequestPart("request") SaveApiTestCaseRequest request, @RequestPart(value = "files") List<MultipartFile> bodyFiles) {
|
||||
return apiTestCaseService.create(request, bodyFiles);
|
||||
}
|
||||
|
||||
@PostMapping(value = "/update", consumes = {"multipart/form-data"})
|
||||
public void update(@RequestPart("request") SaveApiTestCaseRequest request, @RequestPart(value = "files") List<MultipartFile> bodyFiles) {
|
||||
apiTestCaseService.update(request, bodyFiles);
|
||||
public ApiTestCase update(@RequestPart("request") SaveApiTestCaseRequest request, @RequestPart(value = "files") List<MultipartFile> bodyFiles) {
|
||||
return apiTestCaseService.update(request, bodyFiles);
|
||||
}
|
||||
|
||||
@GetMapping("/delete/{id}")
|
||||
|
|
|
@ -116,10 +116,11 @@ public class ApiTestCaseService {
|
|||
return apiTestCaseMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
public void create(SaveApiTestCaseRequest request, List<MultipartFile> bodyFiles) {
|
||||
public ApiTestCase create(SaveApiTestCaseRequest request, List<MultipartFile> bodyFiles) {
|
||||
List<String> bodyUploadIds = new ArrayList<>(request.getBodyUploadIds());
|
||||
ApiTestCase test = createTest(request);
|
||||
createBodyFiles(test, bodyUploadIds, bodyFiles);
|
||||
return test;
|
||||
}
|
||||
|
||||
private void checkQuota() {
|
||||
|
@ -129,13 +130,13 @@ public class ApiTestCaseService {
|
|||
}
|
||||
}
|
||||
|
||||
public void update(SaveApiTestCaseRequest request, List<MultipartFile> bodyFiles) {
|
||||
|
||||
public ApiTestCase update(SaveApiTestCaseRequest request, List<MultipartFile> bodyFiles) {
|
||||
deleteFileByTestId(request.getId());
|
||||
List<String> bodyUploadIds = new ArrayList<>(request.getBodyUploadIds());
|
||||
request.setBodyUploadIds(null);
|
||||
ApiTestCase test = updateTest(request);
|
||||
createBodyFiles(test, bodyUploadIds, bodyFiles);
|
||||
return test;
|
||||
}
|
||||
|
||||
private void createBodyFiles(ApiTestCase test, List<String> bodyUploadIds, List<MultipartFile> bodyFiles) {
|
||||
|
|
|
@ -665,7 +665,7 @@
|
|||
let obj = JSON.parse(JSON.stringify(row));
|
||||
obj.resourceId = getUUID();
|
||||
if (obj.name) {
|
||||
obj.name = obj.name + '_copy';
|
||||
obj.name = obj.name + '_copy';
|
||||
}
|
||||
hashTree.push(obj);
|
||||
this.sort();
|
||||
|
@ -817,21 +817,23 @@
|
|||
}
|
||||
})
|
||||
// 场景变量csv 文件
|
||||
this.currentScenario.variables.forEach(param => {
|
||||
if (param.type === 'CSV' && param.files) {
|
||||
param.files.forEach(item => {
|
||||
if (item.file) {
|
||||
if (!item.id) {
|
||||
let fileId = getUUID().substring(0, 12);
|
||||
item.name = item.file.name;
|
||||
item.id = fileId;
|
||||
if (this.currentScenario.variables) {
|
||||
this.currentScenario.variables.forEach(param => {
|
||||
if (param.type === 'CSV' && param.files) {
|
||||
param.files.forEach(item => {
|
||||
if (item.file) {
|
||||
if (!item.id) {
|
||||
let fileId = getUUID().substring(0, 12);
|
||||
item.name = item.file.name;
|
||||
item.id = fileId;
|
||||
}
|
||||
obj.bodyUploadIds.push(item.id);
|
||||
bodyUploadFiles.push(item.file);
|
||||
}
|
||||
obj.bodyUploadIds.push(item.id);
|
||||
bodyUploadFiles.push(item.file);
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
return bodyUploadFiles;
|
||||
},
|
||||
editScenario(showMessage) {
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
@click="active(apiCase)"/>
|
||||
<el-input v-if="!apiCase.id || isShowInput" size="small" v-model="apiCase.name" :name="index" :key="index"
|
||||
class="ms-api-header-select" style="width: 180px"
|
||||
@blur="saveTestCase(apiCase)" placeholder="请输入用例名称"/>
|
||||
@blur="saveTestCase(apiCase)" :placeholder="$t('commons.input_name')"/>
|
||||
<span v-else>
|
||||
{{ apiCase.id ? apiCase.name : '' }}
|
||||
<i class="el-icon-edit" style="cursor:pointer" @click="showInput(apiCase)" v-tester/>
|
||||
|
@ -211,9 +211,12 @@ export default {
|
|||
if (tmp.tags instanceof Array) {
|
||||
tmp.tags = JSON.stringify(tmp.tags);
|
||||
}
|
||||
this.$fileUpload(url, null, bodyFiles, tmp, () => {
|
||||
this.$fileUpload(url, null, bodyFiles, tmp, (response) => {
|
||||
let data = response.data;
|
||||
row.id = data.id;
|
||||
row.createTime = data.createTime;
|
||||
row.updateTime = data.updateTime;
|
||||
this.$success(this.$t('commons.save_success'));
|
||||
this.$emit('refresh');
|
||||
});
|
||||
},
|
||||
showInput(row) {
|
||||
|
|
|
@ -3,12 +3,20 @@
|
|||
:modal="false" width="45%" :destroy-on-close="true">
|
||||
<span>{{ $t('api_test.automation.scenario_ref') }}:</span>
|
||||
<div class="refs" v-loading="scenarioLoading">
|
||||
<div v-for="(item, index) in scenarioRefs" :key="index" class="el-button--text">{{ item.name }}</div>
|
||||
<div v-for="(item, index) in scenarioRefs" :key="index" class="el-button--text">
|
||||
<router-link :to="{name: 'ApiAutomation', params: { dataSelectRange: 'edit:' + item.id }}">
|
||||
{{ item.name }}
|
||||
</router-link>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<span>{{ $t('api_test.automation.plan_ref') }}:</span>
|
||||
<div class="refs">
|
||||
<div v-for="(item, index) in planRefs" :key="index" class="el-button--text">{{ item.name }}</div>
|
||||
<div v-for="(item, index) in planRefs" :key="index" class="el-button--text">
|
||||
<router-link :to="'/track/plan/view/' + item.id">
|
||||
{{ item.name }}
|
||||
</router-link>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<template v-slot:footer>
|
||||
|
|
|
@ -3,17 +3,17 @@
|
|||
<el-header height="0">
|
||||
<div style="float: right">
|
||||
<div v-if="tipsType==='1'">
|
||||
🤔️天凉了,保温杯买了吗?
|
||||
🤔️ 天凉了,保温杯买了吗?
|
||||
</div>
|
||||
<div v-else-if="tipsType==='2'">
|
||||
😔觉得MeterSphere不好用就来
|
||||
😔 觉得MeterSphere不好用就来
|
||||
<el-link href="https://github.com/metersphere/metersphere/issues" target="_blank" style="color: black"
|
||||
type="primary">https://github.com/metersphere/metersphere/issues
|
||||
</el-link>
|
||||
吐个槽吧!
|
||||
</div>
|
||||
<div v-else-if="tipsType==='3'">
|
||||
😄觉得MeterSphere好用就来
|
||||
😄 觉得MeterSphere好用就来
|
||||
<el-link href="https://github.com/metersphere/metersphere" target="_blank" style="color: black"
|
||||
type="primary">https://github.com/metersphere/metersphere
|
||||
</el-link>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
.drag-bar {
|
||||
height: 1px;
|
||||
width: 100%;
|
||||
z-index: 9999;
|
||||
z-index: 1000;
|
||||
cursor: row-resize;
|
||||
position: fixed;
|
||||
background-color: #E6E6E6;
|
||||
|
|
|
@ -79,11 +79,11 @@
|
|||
],
|
||||
loadTestCases: [
|
||||
{
|
||||
caseName: 'testCase4',
|
||||
projectName: 'P3',
|
||||
userName: '/module1/module2',
|
||||
caseName: 'testCase5',
|
||||
projectName: '测试项目',
|
||||
userName: 'Tom',
|
||||
createTime: new Date(),
|
||||
status: 'error',
|
||||
caseStatus: 'error',
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -33,43 +33,27 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="status"
|
||||
column-key="status"
|
||||
:filters="statusFilters"
|
||||
:label="$t('commons.status')">
|
||||
prop="caseStatus"
|
||||
:label="$t('test_track.plan.load_case.execution_status')">
|
||||
<template v-slot:default="{row}">
|
||||
<ms-performance-test-status :row="row"/>
|
||||
<el-tag size="mini" type="danger" v-if="row.caseStatus === 'error'">
|
||||
{{ row.caseStatus }}
|
||||
</el-tag>
|
||||
<el-tag size="mini" type="success" v-else-if="row.caseStatus === 'success'">
|
||||
{{ row.caseStatus }}
|
||||
</el-tag>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column-->
|
||||
<!-- prop="caseStatus"-->
|
||||
<!-- :label="$t('test_track.plan.load_case.execution_status')">-->
|
||||
<!-- <template v-slot:default="{row}">-->
|
||||
<!-- <el-tag size="mini" type="danger" v-if="row.caseStatus === 'error'">-->
|
||||
<!-- {{ row.caseStatus }}-->
|
||||
<!-- </el-tag>-->
|
||||
<!-- <el-tag size="mini" type="success" v-else-if="row.caseStatus === 'success'">-->
|
||||
<!-- {{ row.caseStatus }}-->
|
||||
<!-- </el-tag>-->
|
||||
<!-- <span v-else>-</span>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MsTag from "@/business/components/common/components/MsTag";
|
||||
import PriorityTableItem from "@/business/components/track/common/tableItems/planview/PriorityTableItem";
|
||||
import TypeTableItem from "@/business/components/track/common/tableItems/planview/TypeTableItem";
|
||||
import MethodTableItem from "@/business/components/track/common/tableItems/planview/MethodTableItem";
|
||||
import StatusTableItem from "@/business/components/track/common/tableItems/planview/StatusTableItem";
|
||||
import MsPerformanceTestStatus from "@/business/components/performance/test/PerformanceTestStatus";
|
||||
|
||||
export default {
|
||||
name: "LoadFailureCasesList",
|
||||
components: {MsTag, PriorityTableItem, TypeTableItem, MethodTableItem, StatusTableItem, MsPerformanceTestStatus},
|
||||
props: ['loadTestCases'],
|
||||
data() {
|
||||
return {
|
||||
|
|
Loading…
Reference in New Issue