fix(接口定义): #1006058 #1006077 #1006216 #1005343 #1006188 接口用例名称过长时优化;swagger定时同步,添加任务通知优化;】error状态鼠标悬停后提示气泡弹窗显示优化

【【接口测试-接口定义】接口用例名称过长时显示串行,建议超过一定自负后用...省略】https://www.tapd.cn/55049933/bugtrace/bugs/view?bug_id=1155049933001006058;【【接口定义】swagger定时同步,添加任务通知,保存,提示优化】https://www.tapd.cn/55049933/bugtrace/bugs/view?bug_id=1155049933001006077;
【【接口测试-测试报告】error状态鼠标悬停后提示气泡弹窗显示id】https://www.tapd.cn/55049933/bugtrace/bugs/view?bug_id=1155049933001006216;
【【接口测试】国际化问题】https://www.tapd.cn/55049933/bugtrace/bugs/view?bug_id=1155049933001005343;
【【接口定义】case列表删除用例,api列表用例数没减少】https://www.tapd.cn/55049933/bugtrace/bugs/view?bug_id=1155049933001006188
This commit is contained in:
song-tianyang 2021-08-27 17:01:39 +08:00 committed by 刘瑞斌
parent bd5370ff4c
commit aa182ccc6b
10 changed files with 42 additions and 20 deletions

View File

@ -780,7 +780,7 @@ public class ApiDefinitionService {
}
public ApiDefinitionImport apiTestImport(MultipartFile file, ApiTestImportRequest request) {
//通过platform获取对应的导入解析类型
ApiImportParser apiImportParser = ApiDefinitionImportParserFactory.getApiImportParser(request.getPlatform());
ApiDefinitionImport apiImport = null;
try {

View File

@ -21,6 +21,7 @@ import io.metersphere.i18n.Translator;
import io.metersphere.log.vo.OperatingLogDetails;
import io.metersphere.notice.sender.NoticeModel;
import io.metersphere.notice.service.NoticeSendService;
import io.metersphere.service.ProjectService;
import io.metersphere.service.SystemParameterService;
import io.metersphere.track.Factory.ReportComponentFactory;
import io.metersphere.track.domain.ReportComponent;
@ -76,6 +77,8 @@ public class TestPlanReportService {
ApiTestCaseMapper apiTestCaseMapper;
@Resource
LoadTestReportMapper loadTestReportMapper;
@Resource
ProjectService projectService;
@Lazy
@Resource
TestPlanService testPlanService;
@ -757,9 +760,9 @@ public class TestPlanReportService {
// testPlan.setStatus(TestPlanStatus.Completed.name());
testPlanMapper.updateByPrimaryKeySelective(testPlan);
}
if (StringUtils.equalsAny(report.getTriggerMode(), ReportTriggerMode.API.name(), ReportTriggerMode.SCHEDULE.name())) {
if (testPlan != null && StringUtils.equalsAny(report.getTriggerMode(), ReportTriggerMode.API.name(), ReportTriggerMode.SCHEDULE.name())) {
//发送通知
sendMessage(report);
sendMessage(report,testPlan.getProjectId());
}
} catch (Exception e) {
@ -771,7 +774,7 @@ public class TestPlanReportService {
return report;
}
public void sendMessage(TestPlanReport testPlanReport) {
public void sendMessage(TestPlanReport testPlanReport,String projectId) {
TestPlan testPlan = testPlanMapper.selectByPrimaryKey(testPlanReport.getTestPlanId());
assert testPlan != null;
SystemParameterService systemParameterService = CommonBeanFactory.getBean(SystemParameterService.class);
@ -827,7 +830,9 @@ public class TestPlanReportService {
.subject(subject)
.paramMap(paramMap)
.build();
noticeSendService.send(testPlanReport.getTriggerMode(), noticeModel);
// noticeSendService.send(testPlanReport.getTriggerMode(), noticeModel);
Organization organization = projectService.getOrganizationByProjectId(projectId);
noticeSendService.send(organization, testPlanReport.getTriggerMode(), noticeModel);
}
public TestPlanReport getTestPlanReport(String planId) {
@ -1051,12 +1056,12 @@ public class TestPlanReportService {
int unFinishNum = executeInfo.countUnFinishedNum();
if(unFinishNum > 0){
//如果间隔超过5分钟没有案例执行完成则把执行结果变成false
long lastCountTime = executeInfo.getLastFinishedNumCountTime();
long nowTime = System.currentTimeMillis();
if(nowTime - lastCountTime > 300000){
TestPlanReportExecuteCatch.finishAllTask(planReportId);
}
long lastCountTime = executeInfo.getLastFinishedNumCountTime();
long nowTime = System.currentTimeMillis();
if(nowTime - lastCountTime > 300000){
TestPlanReportExecuteCatch.finishAllTask(planReportId);
}
}
this.updateExecuteApis(planReportId);
}

View File

@ -132,6 +132,7 @@
:is-read-only="isReadOnly"
@changeSelectDataRangeAll="changeSelectDataRangeAll"
@handleCase="handleCase"
@refreshTable="refresh"
@showExecResult="showExecResult"
ref="caseList"/>
<api-documents-page

View File

@ -27,7 +27,10 @@
class="ms-api-header-select" style="width: 180px"
@blur="saveTestCase(apiCase,true)" :placeholder="$t('commons.input_name')" ref="nameEdit"/>
<span v-else>
<span>{{ apiCase.id ? apiCase.name : '' }}</span>
<el-tooltip :content="apiCase.id ? apiCase.name : ''" placement="top">
<span>{{ apiCase.id ? apiCase.name : '' | ellipsis }}</span>
</el-tooltip>
<i class="el-icon-edit" style="cursor:pointer" @click="showInput(apiCase)"/>
</span>
@ -176,6 +179,17 @@ import MsChangeHistory from "../../../../history/ChangeHistory";
export default {
name: "ApiCaseItem",
filters: {
ellipsis (value) {
if (!value) {
return '';
}
if (value.length > 20) {
return value.slice(0,20) + '...'
}
return value
}
},
components: {
ApiResponseComponent,
MsInputTag,

View File

@ -57,7 +57,7 @@
<el-col :span="8">
<el-form-item :label="$t('commons.status')" prop="status">
<el-select class="ms-http-select" size="small" v-model="httpForm.status">
<el-option v-for="item in options" :key="item.id" :label="item.label" :value="item.id"/>
<el-option v-for="item in options" :key="item.id" :label="$t(item.label)" :value="item.id"/>
</el-select>
</el-form-item>
</el-col>

View File

@ -250,7 +250,6 @@ export default {
},
addTask(data) {
data.testId = this.apiTestId;
this.$success(this.$t('commons.save_success'));
this.result = this.$post("/notice/save/message/task", data, () => {
this.initForm();
this.$success(this.$t('commons.save_success'));

View File

@ -54,7 +54,7 @@
<template slot-scope="scope">
<!-- 判断为只读用户的话不可点击ID进行编辑操作 -->
<span style="cursor:pointer" v-if="isReadOnly"> {{ scope.row.num }} </span>
<el-tooltip v-else content="编辑">
<el-tooltip v-else :content="$t('commons.edit')">
<a style="cursor:pointer" @click="handleTestCase(scope.row)"> {{ scope.row.num }} </a>
</el-tooltip>
</template>
@ -719,6 +719,7 @@ export default {
this.$refs.caseTable.clearSelectRows();
this.initTable();
this.$success(this.$t('commons.delete_success'));
this.$emit('refreshTable');
});
}
}
@ -795,7 +796,8 @@ export default {
this.$get('/api/testcase/deleteToGc/' + apiCase.id, () => {
this.$success(this.$t('commons.delete_success'));
this.initTable();
this.$emit("refreshTree");
this.$emit('refreshTable');
});
}
}

View File

@ -87,9 +87,9 @@ export const REVIEW_STATUS = [
{id: 'UnPass', label: '未通过'}
];
export const API_STATUS = [
{id: 'Prepare', label: '未开始'},
{id: 'Underway', label: '进行中'},
{id: 'Completed', label: '已完成'}
{id: 'Prepare', label: 'test_track.plan.plan_status_prepare'},
{id: 'Underway', label: 'test_track.plan.plan_status_running'},
{id: 'Completed', label: 'test_track.plan.plan_status_finished'}
];
export const TEST = [
{id: 'performance', name: '性能测试', module: 'performance'},

View File

@ -2,6 +2,7 @@
<el-dialog :title="$t('table.header_display_field')" :visible.sync="visible" :append-to-body="true">
<tree-transfer :title="[$t('table.fields_to_be_selected'), $t('table.selected_fields')]"
:from_data='fromFields'
:placeholder="$t('api_test.request.parameters_mock_filter_tips')"
:draggable="true"
:to_data='selectedFields'
:defaultProps="{label:'label'}"

View File

@ -806,7 +806,7 @@ export default {
select_case: "Search use cases",
select_api: "Search api",
case: "Case",
responsible: "Responsible",
responsible: "Executor",
title: "Create api",
path_info: "Please enter the URL of the interface, such as /api/demo/#{id}, where id is the path parameter",
path_all_info: "Please enter the complete test address",
@ -918,7 +918,7 @@ export default {
save_as_api: "Save as api",
delete_step: "Delete step",
reference_deleted_info: "Reference scene has been deleted",
follow_people: "Follow people",
follow_people: "Follow",
create_tag: "Create tag",
scenario_step: "Ccenario step",
step_total: "Step total",