Merge remote-tracking branch 'origin/v1.8' into v1.8
# Conflicts: # frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue
This commit is contained in:
commit
ae3d1adf33
|
@ -7,12 +7,12 @@ 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.ApiRunMode;
|
||||
import io.metersphere.commons.constants.RoleConstants;
|
||||
import io.metersphere.commons.utils.PageUtils;
|
||||
import io.metersphere.commons.utils.Pager;
|
||||
import io.metersphere.commons.utils.SessionUtils;
|
||||
import io.metersphere.track.request.testcase.ApiCaseRelevanceRequest;
|
||||
import io.metersphere.track.service.TestPlanApiCaseService;
|
||||
import org.apache.shiro.authz.annotation.Logical;
|
||||
import org.apache.shiro.authz.annotation.RequiresRoles;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
@ -29,7 +29,8 @@ public class ApiTestCaseController {
|
|||
|
||||
@Resource
|
||||
private ApiTestCaseService apiTestCaseService;
|
||||
|
||||
@Resource
|
||||
private TestPlanApiCaseService testPlanApiCaseService;
|
||||
@PostMapping("/list")
|
||||
public List<ApiTestCaseResult> list(@RequestBody ApiTestCaseRequest request) {
|
||||
request.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
|
||||
|
@ -48,6 +49,12 @@ public class ApiTestCaseController {
|
|||
return null;
|
||||
}
|
||||
}
|
||||
@GetMapping("/getStateByTestPlan/{id}")
|
||||
public String getStateByTestPlan(@PathVariable String id ) {
|
||||
String status=testPlanApiCaseService.getState(id);
|
||||
return status;
|
||||
|
||||
}
|
||||
|
||||
@PostMapping("/list/{goPage}/{pageSize}")
|
||||
public Pager<List<ApiTestCaseDTO>> listSimple(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody ApiTestCaseRequest request) {
|
||||
|
@ -133,5 +140,6 @@ public class ApiTestCaseController {
|
|||
@GetMapping(value = "/jenkins/exec/result/{id}")
|
||||
public String getExecResult(@PathVariable String id) {
|
||||
return apiTestCaseService.getExecResult(id);
|
||||
|
||||
}
|
||||
}
|
|
@ -183,9 +183,16 @@ public class MsHTTPSamplerProxy extends MsTestElement {
|
|||
if (!url.startsWith("http://") && !url.startsWith("https://")) {
|
||||
url = "http://" + url;
|
||||
}
|
||||
if (StringUtils.isNotEmpty(this.getPort()) && this.getPort().startsWith("${")) {
|
||||
url.replaceAll(this.getPort(), "10990");
|
||||
}
|
||||
URL urlObject = new URL(url);
|
||||
sampler.setDomain(URLDecoder.decode(urlObject.getHost(), "UTF-8"));
|
||||
if (urlObject.getPort() > 0 && urlObject.getPort() != 10990 && StringUtils.isNotEmpty(this.getPort()) && this.getPort().startsWith("${")) {
|
||||
sampler.setPort(urlObject.getPort());
|
||||
} else {
|
||||
sampler.setProperty("HTTPSampler.port", this.getPort());
|
||||
}
|
||||
sampler.setProtocol(urlObject.getProtocol());
|
||||
String envPath = StringUtils.equals(urlObject.getPath(), "/") ? "" : urlObject.getPath();
|
||||
sampler.setPath(envPath);
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
package io.metersphere.api.jmeter;
|
||||
|
||||
import io.metersphere.api.dto.definition.ApiTestCaseInfo;
|
||||
import io.metersphere.api.dto.scenario.request.RequestType;
|
||||
import io.metersphere.api.service.*;
|
||||
import io.metersphere.base.domain.ApiDefinitionExecResult;
|
||||
import io.metersphere.base.domain.ApiScenarioReport;
|
||||
import io.metersphere.base.domain.ApiTestReport;
|
||||
import io.metersphere.base.domain.TestPlanReport;
|
||||
import io.metersphere.commons.constants.*;
|
||||
import io.metersphere.commons.utils.CommonBeanFactory;
|
||||
import io.metersphere.commons.utils.LogUtil;
|
||||
|
@ -16,7 +14,6 @@ import io.metersphere.notice.sender.NoticeModel;
|
|||
import io.metersphere.notice.service.NoticeSendService;
|
||||
import io.metersphere.service.SystemParameterService;
|
||||
import io.metersphere.track.service.TestPlanReportService;
|
||||
import io.metersphere.track.service.TestPlanService;
|
||||
import io.metersphere.track.service.TestPlanTestCaseService;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
@ -250,9 +247,12 @@ public class APIBackendListenerClient extends AbstractBackendListenerClient impl
|
|||
|
||||
}
|
||||
}
|
||||
if (StringUtils.equals(ReportTriggerMode.API.name(), report.getTriggerMode())||StringUtils.equals(ReportTriggerMode.SCHEDULE.name(), report.getTriggerMode())) {
|
||||
sendTask(report, reportUrl, testResult);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static void sendTask(ApiTestReport report, String reportUrl, TestResult testResult) {
|
||||
if (report == null) {
|
||||
return;
|
||||
|
|
|
@ -19,6 +19,7 @@ import io.metersphere.api.jmeter.JMeterService;
|
|||
import io.metersphere.base.domain.*;
|
||||
import io.metersphere.base.mapper.*;
|
||||
import io.metersphere.base.mapper.ext.*;
|
||||
import io.metersphere.commons.constants.ApiRunMode;
|
||||
import io.metersphere.commons.constants.TestPlanStatus;
|
||||
import io.metersphere.commons.exception.MSException;
|
||||
import io.metersphere.commons.utils.*;
|
||||
|
@ -551,7 +552,14 @@ public class ApiTestCaseService {
|
|||
}
|
||||
|
||||
public String run(RunCaseRequest request) {
|
||||
ApiTestCaseWithBLOBs testCaseWithBLOBs = apiTestCaseMapper.selectByPrimaryKey(request.getCaseId());
|
||||
ApiTestCaseWithBLOBs testCaseWithBLOBs=new ApiTestCaseWithBLOBs();
|
||||
if(StringUtils.equals(request.getRunMode(), ApiRunMode.JENKINS_API_PLAN.name())){
|
||||
testCaseWithBLOBs= apiTestCaseMapper.selectByPrimaryKey(request.getReportId());
|
||||
request.setCaseId(request.getReportId());
|
||||
}else{
|
||||
testCaseWithBLOBs= apiTestCaseMapper.selectByPrimaryKey(request.getCaseId());
|
||||
|
||||
}
|
||||
// 多态JSON普通转换会丢失内容,需要通过 ObjectMapper 获取
|
||||
if (testCaseWithBLOBs != null && StringUtils.isNotEmpty(testCaseWithBLOBs.getRequest())) {
|
||||
try {
|
||||
|
|
|
@ -91,6 +91,9 @@
|
|||
<if test="reportRequest.projectId != null">
|
||||
AND project.id = #{reportRequest.projectId,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="reportRequest.testId != null">
|
||||
AND ltr.test_id = #{reportRequest.testId,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="reportRequest.filters != null and reportRequest.filters.size() > 0">
|
||||
<foreach collection="reportRequest.filters.entrySet()" index="key" item="values">
|
||||
<if test="values != null and values.size() > 0">
|
||||
|
|
|
@ -12,6 +12,7 @@ import java.util.Map;
|
|||
public class ReportRequest {
|
||||
private String name;
|
||||
private String workspaceId;
|
||||
private String testId;
|
||||
private String userId;
|
||||
private List<OrderRequest> orders;
|
||||
private Map<String, List<String>> filters;
|
||||
|
|
|
@ -14,13 +14,11 @@ import io.metersphere.excel.domain.ExcelResponse;
|
|||
import io.metersphere.service.CheckPermissionService;
|
||||
import io.metersphere.service.FileService;
|
||||
import io.metersphere.track.dto.TestCaseDTO;
|
||||
import io.metersphere.track.dto.TestPlanCaseDTO;
|
||||
import io.metersphere.track.request.testcase.EditTestCaseRequest;
|
||||
import io.metersphere.track.request.testcase.QueryTestCaseRequest;
|
||||
import io.metersphere.track.request.testcase.TestCaseBatchRequest;
|
||||
import io.metersphere.track.request.testcase.TestCaseMinderEditRequest;
|
||||
import io.metersphere.track.request.testplan.FileOperationRequest;
|
||||
import io.metersphere.track.request.testplancase.QueryTestPlanCaseRequest;
|
||||
import io.metersphere.track.service.TestCaseService;
|
||||
import org.apache.shiro.authz.annotation.Logical;
|
||||
import org.apache.shiro.authz.annotation.RequiresRoles;
|
||||
|
@ -126,8 +124,8 @@ public class TestCaseController {
|
|||
|
||||
@PostMapping(value = "/edit", consumes = {"multipart/form-data"})
|
||||
@RequiresRoles(value = {RoleConstants.TEST_USER, RoleConstants.TEST_MANAGER}, logical = Logical.OR)
|
||||
public void editTestCase(@RequestPart("request") EditTestCaseRequest request, @RequestPart(value = "file") List<MultipartFile> files) {
|
||||
testCaseService.edit(request, files);
|
||||
public String editTestCase(@RequestPart("request") EditTestCaseRequest request, @RequestPart(value = "file") List<MultipartFile> files) {
|
||||
return testCaseService.edit(request, files);
|
||||
}
|
||||
|
||||
@PostMapping("/delete/{testCaseId}")
|
||||
|
|
|
@ -165,7 +165,7 @@ public class TestCaseService {
|
|||
String steps = tc.getSteps();
|
||||
String remark = tc.getRemark();
|
||||
if (StringUtils.equals(steps, testCase.getSteps()) && StringUtils.equals(remark, caseRemark)) {
|
||||
MSException.throwException(Translator.get("test_case_already_exists"));
|
||||
//MSException.throwException(Translator.get("test_case_already_exists"));
|
||||
isExt = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,21 +1,13 @@
|
|||
package io.metersphere.track.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import io.metersphere.api.dto.definition.ApiTestCaseDTO;
|
||||
import io.metersphere.api.dto.definition.ApiTestCaseRequest;
|
||||
import io.metersphere.api.dto.definition.RunDefinitionRequest;
|
||||
import io.metersphere.api.dto.definition.TestPlanApiCaseDTO;
|
||||
import io.metersphere.api.dto.definition.request.MsTestElement;
|
||||
import io.metersphere.api.dto.definition.request.MsTestPlan;
|
||||
import io.metersphere.api.dto.definition.request.MsThreadGroup;
|
||||
import io.metersphere.api.service.ApiDefinitionExecResultService;
|
||||
import io.metersphere.api.service.ApiDefinitionService;
|
||||
import io.metersphere.api.service.ApiTestCaseService;
|
||||
import io.metersphere.base.domain.ApiTestCaseExample;
|
||||
import io.metersphere.base.domain.ApiTestCaseWithBLOBs;
|
||||
import io.metersphere.base.domain.TestPlanApiCase;
|
||||
import io.metersphere.base.domain.TestPlanApiCaseExample;
|
||||
import io.metersphere.base.mapper.TestPlanApiCaseMapper;
|
||||
|
@ -25,15 +17,16 @@ import io.metersphere.commons.utils.Pager;
|
|||
import io.metersphere.commons.utils.ServiceUtils;
|
||||
import io.metersphere.commons.utils.SessionUtils;
|
||||
import io.metersphere.track.request.testcase.TestPlanApiCaseBatchRequest;
|
||||
import org.apache.jmeter.testelement.TestElement;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
|
@ -150,4 +143,11 @@ public class TestPlanApiCaseService {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
public String getState(String id) {
|
||||
TestPlanApiCaseExample example = new TestPlanApiCaseExample();
|
||||
example.createCriteria().andApiCaseIdEqualTo(id);
|
||||
return testPlanApiCaseMapper.selectByExample(example).get(0).getStatus();
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
-- api_scenario_report modify column length
|
||||
ALTER TABLE api_scenario_report MODIFY COLUMN name VARCHAR(300);
|
|
@ -381,7 +381,6 @@
|
|||
},
|
||||
methods: {
|
||||
customHeader() {
|
||||
getLabel(this, API_SCENARIO_LIST);
|
||||
this.$refs.headerCustom.open(this.tableLabel)
|
||||
},
|
||||
selectByParam() {
|
||||
|
|
|
@ -267,11 +267,9 @@ export default {
|
|||
this.$nextTick(() => {
|
||||
this.$refs.caseTable.bodyWrapper.scrollTop = 5
|
||||
})
|
||||
getLabel(this, API_CASE_LIST);
|
||||
},
|
||||
watch: {
|
||||
selectNodeIds() {
|
||||
getLabel(this, API_CASE_LIST);
|
||||
this.selectAll = false;
|
||||
this.unSelection = [];
|
||||
this.selectDataCounts = 0;
|
||||
|
@ -306,11 +304,9 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
customHeader() {
|
||||
getLabel(this, API_CASE_LIST);
|
||||
this.$refs.headerCustom.open(this.tableLabel)
|
||||
},
|
||||
initTable() {
|
||||
getLabel(this, API_CASE_LIST);
|
||||
this.selectRows = new Set();
|
||||
this.condition.status = "";
|
||||
this.condition.moduleIds = this.selectNodeIds;
|
||||
|
|
|
@ -383,7 +383,6 @@
|
|||
this.getSystemLabel(this.type)
|
||||
this.initTable();
|
||||
this.getMaintainerOptions();
|
||||
getLabel(this, API_LIST);
|
||||
},
|
||||
watch: {
|
||||
selectNodeIds() {
|
||||
|
@ -416,7 +415,6 @@
|
|||
})
|
||||
},
|
||||
customHeader() {
|
||||
getLabel(this, API_LIST);
|
||||
this.$refs.headerCustom.open(this.tableLabel)
|
||||
},
|
||||
handleBatchMove() {
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
<template>
|
||||
<ms-container>
|
||||
<ms-main-container>
|
||||
<el-card>
|
||||
|
||||
</el-card>
|
||||
</ms-main-container>
|
||||
</ms-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MsContainer from "@/business/components/common/components/MsContainer";
|
||||
import MsMainContainer from "@/business/components/common/components/MsMainContainer";
|
||||
import {checkoutTestManagerOrTestUser} from "@/common/js/utils";
|
||||
|
||||
export default {
|
||||
name: "PerformanceReportCompare",
|
||||
components: {MsMainContainer, MsContainer},
|
||||
mounted() {
|
||||
let reportId = this.$route.path.split('/')[4];
|
||||
console.log(reportId);
|
||||
let items = localStorage.getItem("compareReportIds");
|
||||
console.log(JSON.parse(items));
|
||||
},
|
||||
computed: {
|
||||
isReadOnly() {
|
||||
return !checkoutTestManagerOrTestUser();
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
methods: {}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
|
@ -28,10 +28,6 @@
|
|||
<el-button :disabled="isReadOnly" type="warning" plain size="mini" @click="downloadJtl()">
|
||||
{{ $t('report.downloadJtl') }}
|
||||
</el-button>
|
||||
|
||||
<!--<el-button :disabled="isReadOnly" type="warning" plain size="mini">-->
|
||||
<!--{{$t('report.compare')}}-->
|
||||
<!--</el-button>-->
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
|
@ -83,6 +79,7 @@
|
|||
</div>
|
||||
</el-dialog>
|
||||
</ms-main-container>
|
||||
<same-test-reports ref="compareReports"/>
|
||||
</ms-container>
|
||||
</template>
|
||||
|
||||
|
@ -99,11 +96,13 @@ import {checkoutTestManagerOrTestUser, exportPdf} from "@/common/js/utils";
|
|||
import html2canvas from 'html2canvas';
|
||||
import MsPerformanceReportExport from "./PerformanceReportExport";
|
||||
import {Message} from "element-ui";
|
||||
import SameTestReports from "@/business/components/performance/report/components/SameTestReports";
|
||||
|
||||
|
||||
export default {
|
||||
name: "PerformanceReportView",
|
||||
components: {
|
||||
SameTestReports,
|
||||
MsPerformanceReportExport,
|
||||
MsReportErrorLog,
|
||||
MsReportLogDetails,
|
||||
|
@ -312,6 +311,9 @@ export default {
|
|||
Message.error({message: JSON.parse(data).message || e.message, showClose: true});
|
||||
});
|
||||
});
|
||||
},
|
||||
compareReports() {
|
||||
this.$refs.compareReports.open(this.report);
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
|
|
@ -25,37 +25,32 @@
|
|||
<el-table-column
|
||||
prop="name"
|
||||
:label="$t('commons.name')"
|
||||
width="150"
|
||||
show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="testName"
|
||||
:label="$t('report.test_name')"
|
||||
width="150"
|
||||
show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="projectName"
|
||||
:label="$t('report.project_name')"
|
||||
width="150"
|
||||
show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="userName"
|
||||
:label="$t('report.user_name')"
|
||||
width="150"
|
||||
show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
sortable
|
||||
width="250"
|
||||
:label="$t('commons.create_time')">
|
||||
<template v-slot:default="scope">
|
||||
<span>{{ scope.row.createTime | timestampFormatDate }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="triggerMode" width="150" :label="'触发方式'" column-key="triggerMode"
|
||||
<el-table-column prop="triggerMode" width="150" :label="$t('test_track.report.list.trigger_mode')" column-key="triggerMode"
|
||||
:filters="triggerFilters">
|
||||
<template v-slot:default="scope">
|
||||
<report-trigger-mode-item :trigger-mode="scope.row.triggerMode"/>
|
||||
|
@ -85,6 +80,7 @@
|
|||
:total="total"/>
|
||||
</el-card>
|
||||
</ms-main-container>
|
||||
<same-test-reports ref="compareReports"/>
|
||||
</ms-container>
|
||||
</template>
|
||||
|
||||
|
@ -101,11 +97,14 @@ import MsTableHeader from "../../common/components/MsTableHeader";
|
|||
import {LIST_CHANGE, PerformanceEvent} from "@/business/components/common/head/ListEvent";
|
||||
import ShowMoreBtn from "../../track/case/components/ShowMoreBtn";
|
||||
import {_filter, _sort} from "@/common/js/tableUtils";
|
||||
|
||||
import MsDialogFooter from "@/business/components/common/components/MsDialogFooter";
|
||||
import SameTestReports from "@/business/components/performance/report/components/SameTestReports";
|
||||
|
||||
export default {
|
||||
name: "PerformanceTestReportList",
|
||||
components: {
|
||||
SameTestReports,
|
||||
MsDialogFooter,
|
||||
MsTableHeader,
|
||||
ReportTriggerModeItem,
|
||||
MsTableOperatorButton,
|
||||
|
@ -200,6 +199,9 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
handleDiff(report) {
|
||||
this.$refs.compareReports.open(report);
|
||||
},
|
||||
_handleDeleteNoMsg(report) {
|
||||
this.result = this.$post(this.deletePath + report.id, {}, () => {
|
||||
this.initTableData();
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
<el-table-column
|
||||
prop="ko"
|
||||
label="KO"
|
||||
label="FAIL"
|
||||
align="center"
|
||||
/>
|
||||
|
||||
|
|
|
@ -0,0 +1,117 @@
|
|||
<template>
|
||||
<el-dialog :close-on-click-modal="false"
|
||||
:destroy-on-close="true"
|
||||
:title="$t('已完成的测试报告')" width="60%"
|
||||
:visible.sync="loadReportVisible">
|
||||
<el-table v-loading="reportLoadingResult.loading"
|
||||
class="basic-config"
|
||||
:data="compareReports"
|
||||
@select-all="handleSelectAll"
|
||||
@select="handleSelectionChange">
|
||||
|
||||
<el-table-column type="selection"/>
|
||||
<el-table-column
|
||||
prop="name"
|
||||
:label="$t('commons.name')"
|
||||
show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="userName"
|
||||
:label="$t('report.user_name')"
|
||||
show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
<el-table-column prop="triggerMode"
|
||||
:label="$t('test_track.report.list.trigger_mode')">
|
||||
<template v-slot:default="scope">
|
||||
<report-trigger-mode-item :trigger-mode="scope.row.triggerMode"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:label="$t('commons.create_time')">
|
||||
<template v-slot:default="scope">
|
||||
<i class="el-icon-time"/>
|
||||
<span class="last-modified">{{ scope.row.createTime | timestampFormatDate }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<ms-table-pagination :change="getCompareReports" :current-page.sync="currentPage" :page-size.sync="pageSize"
|
||||
:total="total"/>
|
||||
|
||||
<template v-slot:footer>
|
||||
<ms-dialog-footer @cancel="close" @confirm="handleCompare"/>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MsTablePagination from "@/business/components/common/pagination/TablePagination";
|
||||
import MsDialogFooter from "@/business/components/common/components/MsDialogFooter";
|
||||
import ReportTriggerModeItem from "@/business/components/common/tableItem/ReportTriggerModeItem";
|
||||
|
||||
export default {
|
||||
name: "SameTestReports",
|
||||
components: {ReportTriggerModeItem, MsDialogFooter, MsTablePagination},
|
||||
data() {
|
||||
return {
|
||||
loadReportVisible: false,
|
||||
reportLoadingResult: {},
|
||||
compareReports: [],
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
selectIds: new Set,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open(report) {
|
||||
this.getCompareReports(report.testId);
|
||||
this.loadReportVisible = true;
|
||||
},
|
||||
close() {
|
||||
this.loadReportVisible = false;
|
||||
},
|
||||
getCompareReports(testId) {
|
||||
|
||||
let condition = {
|
||||
testId: testId,
|
||||
filters: {status: ["Completed"]}
|
||||
};
|
||||
this.reportLoadingResult = this.$post('/performance/report/list/all/' + this.currentPage + "/" + this.pageSize, condition, res => {
|
||||
let data = res.data;
|
||||
this.total = data.itemCount;
|
||||
this.compareReports = data.listObject;
|
||||
})
|
||||
},
|
||||
handleCompare() {
|
||||
let reportIds = [...this.selectIds];
|
||||
localStorage.setItem("compareReportIds", JSON.stringify(reportIds));
|
||||
this.close();
|
||||
this.$router.push({path: '/performance/report/compare/' + reportIds[0]});
|
||||
},
|
||||
handleSelectAll(selection) {
|
||||
if (selection.length > 0) {
|
||||
this.compareReports.forEach(item => {
|
||||
this.selectIds.add(item.id);
|
||||
});
|
||||
} else {
|
||||
this.compareReports.forEach(item => {
|
||||
if (this.selectIds.has(item.id)) {
|
||||
this.selectIds.delete(item.id);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
handleSelectionChange(selection, row) {
|
||||
if (this.selectIds.has(row.id)) {
|
||||
this.selectIds.delete(row.id);
|
||||
} else {
|
||||
this.selectIds.add(row.id);
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
|
@ -1,5 +1,3 @@
|
|||
import MsProject from "@/business/components/settings/project/MsProject";
|
||||
|
||||
const PerformanceTest = () => import('@/business/components/performance/PerformanceTest')
|
||||
const PerformanceTestHome = () => import('@/business/components/performance/home/PerformanceTestHome')
|
||||
const EditPerformanceTest = () => import('@/business/components/performance/test/EditPerformanceTest')
|
||||
|
@ -7,6 +5,7 @@ const PerformanceTestList = () => import('@/business/components/performance/test
|
|||
const PerformanceTestReportList = () => import('@/business/components/performance/report/PerformanceTestReportList')
|
||||
const PerformanceChart = () => import('@/business/components/performance/report/components/PerformanceChart')
|
||||
const PerformanceReportView = () => import('@/business/components/performance/report/PerformanceReportView')
|
||||
const PerformanceReportCompare = () => import('@/business/components/performance/report/PerformanceReportCompare')
|
||||
|
||||
export default {
|
||||
path: "/performance",
|
||||
|
@ -62,6 +61,11 @@ export default {
|
|||
path: "report/view/:reportId",
|
||||
name: "perReportView",
|
||||
component: PerformanceReportView
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "report/compare/:reportId",
|
||||
name: "ReportCompare",
|
||||
component: PerformanceReportCompare,
|
||||
},
|
||||
]
|
||||
}
|
||||
|
|
|
@ -285,6 +285,7 @@ export default {
|
|||
}
|
||||
},
|
||||
nodeChange(node, nodeIds, pNodes) {
|
||||
this.activeName = "default";
|
||||
this.selectNodeIds = nodeIds;
|
||||
this.selectNode = node;
|
||||
this.selectParentNodes = pNodes;
|
||||
|
@ -323,11 +324,23 @@ export default {
|
|||
showTestCaseDetail(testCase) {
|
||||
this.testCaseReadOnly = true;
|
||||
},
|
||||
refresh() {
|
||||
refresh(data) {
|
||||
this.selectNodeIds = [];
|
||||
this.selectParentNodes = [];
|
||||
this.selectNode = {};
|
||||
this.refreshTable();
|
||||
this.setTable(data);
|
||||
|
||||
},
|
||||
setTable(data) {
|
||||
console.log(data)
|
||||
for (let index in this.tabs) {
|
||||
let tab = this.tabs[index];
|
||||
if (tab.name === this.activeName) {
|
||||
tab.label = data.name;
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
refreshAll() {
|
||||
this.$refs.nodeTree.list();
|
||||
|
|
|
@ -380,6 +380,7 @@ export default {
|
|||
testCases: [],
|
||||
index: 0,
|
||||
showInputTag: true,
|
||||
tableType:"",
|
||||
};
|
||||
},
|
||||
props: {
|
||||
|
@ -631,8 +632,11 @@ export default {
|
|||
})
|
||||
},
|
||||
async setFormData(testCase) {
|
||||
//testCase.tags = JSON.parse(testCase.tags);
|
||||
try {
|
||||
testCase.selected = JSON.parse(testCase.testId);
|
||||
} catch (error) {
|
||||
testCase.selected = testCase.testId
|
||||
}
|
||||
let tmp = {};
|
||||
Object.assign(tmp, testCase);
|
||||
tmp.steps = JSON.parse(testCase.steps);
|
||||
|
@ -643,9 +647,8 @@ export default {
|
|||
Object.assign(this.form, tmp);
|
||||
this.form.module = testCase.nodeId;
|
||||
this.getFileMetaData(testCase);
|
||||
/* testCase.selected = JSON.parse(testCase.testId);
|
||||
this.form.selected= testCase.selected*/
|
||||
await this.loadOptions(this.sysList)
|
||||
|
||||
},
|
||||
setTestCaseExtInfo(testCase) {
|
||||
this.testCase = {};
|
||||
|
@ -710,11 +713,6 @@ export default {
|
|||
this.dialogFormVisible = false;
|
||||
},
|
||||
saveCase() {
|
||||
/*
|
||||
document.getElementById("inputDelay").focus();
|
||||
*/
|
||||
|
||||
// 保存前在input框自动失焦,以免保存失败
|
||||
this.$refs['caseFrom'].validate((valid) => {
|
||||
if (valid) {
|
||||
let param = this.buildParam();
|
||||
|
@ -722,7 +720,10 @@ export default {
|
|||
let option = this.getOption(param);
|
||||
this.result = this.$request(option, (response) => {
|
||||
this.$success(this.$t('commons.save_success'));
|
||||
if (this.operationType == 'add' && this.isCreateContinue) {
|
||||
this.operationType="edit"
|
||||
this.form.id=response.id;
|
||||
this.$emit("refreshTestCase",)
|
||||
/*if (this.operationType == 'add' && this.isCreateContinue) {
|
||||
this.form.name = '';
|
||||
this.form.prerequisite = '';
|
||||
this.form.steps = [{
|
||||
|
@ -736,9 +737,11 @@ export default {
|
|||
this.tableData = [];
|
||||
this.$emit("refresh");
|
||||
return;
|
||||
}
|
||||
this.dialogFormVisible = false;
|
||||
this.$emit("refresh");
|
||||
}*/
|
||||
this.tableType='edit';
|
||||
this.$emit("refresh",this.form);
|
||||
console.log(response.data)
|
||||
this.form.id=response.data
|
||||
if (this.type === 'add' || this.type === 'copy') {
|
||||
param.id = response.data;
|
||||
this.$emit("caseCreate", param);
|
||||
|
@ -777,11 +780,15 @@ export default {
|
|||
return param;
|
||||
},
|
||||
getOption(param) {
|
||||
let formData = new FormData();
|
||||
let type = this.type
|
||||
if (this.type === 'copy') {
|
||||
let type={}
|
||||
if(this.tableType==='edit'){
|
||||
type='edit'
|
||||
}else if(this.type === 'copy'){
|
||||
type = 'add'
|
||||
}else{
|
||||
type=this.type
|
||||
}
|
||||
let formData = new FormData();
|
||||
let url = '/test/case/' + type;
|
||||
this.uploadList.forEach(f => {
|
||||
formData.append("file", f);
|
||||
|
|
|
@ -305,7 +305,7 @@ export default {
|
|||
this.$emit('setCondition', this.condition);
|
||||
this.condition.filters = {reviewStatus: ["Prepare", "Pass", "UnPass"]};
|
||||
this.initTableData();
|
||||
getSystemLabel(this, this.type)
|
||||
|
||||
},
|
||||
activated() {
|
||||
this.condition.filters = {reviewStatus: ["Prepare", "Pass", "UnPass"]};
|
||||
|
@ -323,7 +323,6 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
customHeader() {
|
||||
getLabel(this, TEST_CASE_LIST);
|
||||
this.$refs.headerCustom.open(this.tableLabel)
|
||||
},
|
||||
getSelectDataRange() {
|
||||
|
@ -346,6 +345,7 @@ export default {
|
|||
this.condition.nodeIds = this.selectNodeIds;
|
||||
}
|
||||
getLabel(this, TEST_CASE_LIST);
|
||||
|
||||
this.getData();
|
||||
},
|
||||
getData() {
|
||||
|
|
|
@ -295,7 +295,6 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
inite() {
|
||||
getLabel(this, TEST_PLAN_LIST);
|
||||
this.initTableData()
|
||||
},
|
||||
calPassRate(scope) {
|
||||
|
@ -303,7 +302,6 @@ export default {
|
|||
return Number.parseInt(passRate, 10);
|
||||
},
|
||||
customHeader() {
|
||||
getLabel(this, TEST_PLAN_LIST);
|
||||
this.$refs.headerCustom.open(this.tableLabel)
|
||||
},
|
||||
initTableData() {
|
||||
|
|
|
@ -304,8 +304,6 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
customHeader() {
|
||||
getLabel(this, TEST_PLAN_API_CASE);
|
||||
|
||||
this.$refs.headerCustom.open(this.tableLabel)
|
||||
},
|
||||
getMaintainerOptions() {
|
||||
|
|
|
@ -201,8 +201,6 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
customHeader() {
|
||||
getLabel(this, TEST_PLAN_SCENARIO_CASE);
|
||||
|
||||
this.$refs.headerCustom.open(this.tableLabel)
|
||||
},
|
||||
search() {
|
||||
|
|
|
@ -429,7 +429,6 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
customHeader() {
|
||||
getLabel(this, TEST_PLAN_FUNCTION_TEST_CASE);
|
||||
this.$refs.headerCustom.open(this.tableLabel)
|
||||
},
|
||||
|
||||
|
|
|
@ -211,7 +211,6 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
customHeader() {
|
||||
getLabel(this, TEST_PLAN_LOAD_CASE);
|
||||
this.$refs.headerCustom.open(this.tableLabel)
|
||||
},
|
||||
initTable() {
|
||||
|
|
|
@ -183,7 +183,6 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
customHeader() {
|
||||
getLabel(this, TEST_CASE_REVIEW_LIST);
|
||||
this.$refs.headerCustom.open(this.tableLabel)
|
||||
},
|
||||
|
||||
|
|
|
@ -301,7 +301,6 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
customHeader() {
|
||||
getLabel(this, TEST_CASE_REVIEW_CASE_LIST);
|
||||
this.$refs.headerCustom.open(this.tableLabel)
|
||||
},
|
||||
initTableData() {
|
||||
|
|
|
@ -115,10 +115,7 @@ export function getLabel(vueObj, type) {
|
|||
vueObj.result = vueObj.$post('/system/header/info', param, response => {
|
||||
if (response.data != null) {
|
||||
vueObj.tableLabel = eval(response.data.props);
|
||||
}
|
||||
})
|
||||
}
|
||||
export function getSystemLabel(vueObj, type) {
|
||||
}else{
|
||||
let param = {}
|
||||
param.type=type
|
||||
vueObj.result = vueObj.$post('/system/system/header',param, response => {
|
||||
|
@ -127,6 +124,8 @@ export function getSystemLabel(vueObj, type) {
|
|||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function buildBatchParam(vueObj) {
|
||||
|
|
|
@ -280,7 +280,7 @@ export default {
|
|||
none: 'None Organization',
|
||||
select: 'Select Organization',
|
||||
service_integration: 'Service integration',
|
||||
defect_manage: 'Defect management platform',
|
||||
defect_manage: 'Project management platform',
|
||||
message_settings: 'Message settings',
|
||||
message: {
|
||||
jenkins_task_notification: 'Jenkins task notification',
|
||||
|
@ -541,7 +541,10 @@ export default {
|
|||
threadgroup_at_least_one: 'At least one ThreadGroup is enabled',
|
||||
load_api_automation_jmx: 'Import API automation scenario',
|
||||
project_file_exist: "The file already exists in the project, please import it directly",
|
||||
project_file_update_type_error: 'Updated file types must be consistent'
|
||||
project_file_update_type_error: 'Updated file types must be consistent',
|
||||
report: {
|
||||
diff: "Compare"
|
||||
},
|
||||
},
|
||||
api_test: {
|
||||
creator: "Creator",
|
||||
|
|
|
@ -281,7 +281,7 @@ export default {
|
|||
select: '选择组织',
|
||||
delete_warning: '删除该组织将同步删除该组织下所有相关工作空间和相关工作空间下的所有项目,以及项目中的所有用例、接口测试、性能测试等,确定要删除吗?',
|
||||
service_integration: '服务集成',
|
||||
defect_manage: '缺陷管理平台',
|
||||
defect_manage: '项目管理平台',
|
||||
message_settings: '消息设置',
|
||||
message: {
|
||||
jenkins_task_notification: 'Jenkins接口调用任务通知',
|
||||
|
@ -438,7 +438,7 @@ export default {
|
|||
export: '导出',
|
||||
export_to_ms_format: '导出 MeterSphere 格式',
|
||||
export_to_swagger3_format: '导出 Swagger3.0 格式',
|
||||
compare: '比较',
|
||||
compare: '报告对比',
|
||||
generation_error: '报告生成错误, 无法查看, 请检查日志详情!',
|
||||
being_generated: '报告正在生成中...',
|
||||
delete_confirm: '确认删除报告: ',
|
||||
|
@ -540,7 +540,10 @@ export default {
|
|||
threadgroup_at_least_one: '至少启用一个线程组',
|
||||
load_api_automation_jmx: '引用接口自动化场景',
|
||||
project_file_exist: "项目中已存在该文件,请直接引用",
|
||||
project_file_update_type_error: '更新的文件类型必须一致'
|
||||
report: {
|
||||
diff: "对比"
|
||||
},
|
||||
project_file_update_type_error: '更新的文件类型必须一致',
|
||||
},
|
||||
api_test: {
|
||||
creator: "创建人",
|
||||
|
@ -1193,7 +1196,7 @@ export default {
|
|||
batch_delete_case: '批量删除',
|
||||
batch_unlink: '批量取消关联',
|
||||
project_name: '所属项目',
|
||||
status: '评审状态',
|
||||
status: '评审结果',
|
||||
status_prepare: '未评审',
|
||||
status_pass: '通过',
|
||||
status_un_pass: '未通过',
|
||||
|
|
|
@ -281,7 +281,7 @@ export default {
|
|||
select: '選擇組織',
|
||||
delete_warning: '刪除該組織將同步刪除該組織下所有相關工作空間和相關工作空間下的所有項目,以及項目中的所有用例、接口測試、性能測試等,確定要刪除嗎?',
|
||||
service_integration: '服務集成',
|
||||
defect_manage: '缺陷管理平臺',
|
||||
defect_manage: '項目管理平臺',
|
||||
message_settings: '消息設置',
|
||||
message: {
|
||||
jenkins_task_notification: 'Jenkins接口調用任務通知',
|
||||
|
@ -438,7 +438,7 @@ export default {
|
|||
export: '導出',
|
||||
export_to_ms_format: '導出 MeterSphere 格式',
|
||||
export_to_swagger3_format: '導出 Swagger3.0 格式',
|
||||
compare: '比較',
|
||||
compare: '報告比較',
|
||||
generation_error: '報告生成錯誤, 無法查看, 請檢查日誌詳情!',
|
||||
being_generated: '報告正在生成中...',
|
||||
delete_confirm: '確認刪除報告: ',
|
||||
|
@ -540,7 +540,10 @@ export default {
|
|||
threadgroup_at_least_one: '至少啟用一個線程組',
|
||||
load_api_automation_jmx: '引用接口自動化場景',
|
||||
project_file_exist: "項目中已存在該文件,請直接引用",
|
||||
project_file_update_type_error: '更新的文件類型必須一致'
|
||||
project_file_update_type_error: '更新的文件類型必須一致',
|
||||
report: {
|
||||
diff: "對比"
|
||||
},
|
||||
},
|
||||
api_test: {
|
||||
creator: "創建人",
|
||||
|
|
Loading…
Reference in New Issue