This commit is contained in:
fit2-zhao 2021-02-01 16:04:17 +08:00
commit c94aab0219
13 changed files with 43 additions and 60 deletions

View File

@ -3,7 +3,7 @@ name: BUG 提交
about: 提交产品缺陷帮助我们更好的改进
title: "[BUG]"
labels: bug
assignees: AgAngle
assignees: xulinde
---

View File

@ -168,20 +168,35 @@ public class TestPlanService {
public int editTestPlan(TestPlanDTO testPlan) {
editTestPlanProject(testPlan);
testPlan.setUpdateTime(System.currentTimeMillis());
checkTestPlanExist(testPlan);
//进行中状态写入实际开始时间
if (TestPlanStatus.Underway.name().equals(testPlan.getStatus())) {
testPlan.setActualStartTime(System.currentTimeMillis());
} else if (TestPlanStatus.Completed.name().equals(testPlan.getStatus())) {
//已完成写入实际完成时间
testPlan.setActualEndTime(System.currentTimeMillis());
TestPlan res = testPlanMapper.selectByPrimaryKey(testPlan.getId()); // 先查一次库
if (!res.getStatus().equals(testPlan.getStatus())) { // 若有改变才更新时间
res.setUpdateTime(System.currentTimeMillis());
if (TestPlanStatus.Underway.name().equals(testPlan.getStatus())) {
if (res.getStatus().equals(TestPlanStatus.Prepare.name())) {
res.setActualStartTime(System.currentTimeMillis());
} // 未开始->进行中写入实际开始时间
else if (res.getStatus().equals(TestPlanStatus.Completed.name())) {
res.setActualEndTime(null);
} // 已完成->进行中结束时间置空
}
else if (!res.getStatus().equals(TestPlanStatus.Prepare.name()) &&
testPlan.getStatus().equals(TestPlanStatus.Prepare.name())) {
res.setActualStartTime(null);
res.setActualEndTime(null);
} // 非未开始->未开始时间都置空
else if (TestPlanStatus.Completed.name().equals(testPlan.getStatus()) &&
!TestPlanStatus.Completed.name().equals(res.getStatus())) {
//已完成写入实际完成时间
res.setActualEndTime(System.currentTimeMillis());
}
res.setStatus(testPlan.getStatus());
}
List<String> userIds = new ArrayList<>();
userIds.add(testPlan.getPrincipal());
AddTestPlanRequest testPlans = new AddTestPlanRequest();
int i = testPlanMapper.updateByPrimaryKeySelective(testPlan);
int i = testPlanMapper.updateByPrimaryKey(res); // 更新
if (!StringUtils.isBlank(testPlan.getStatus())) {
BeanUtils.copyBean(testPlans, getTestPlan(testPlan.getId()));
String context = getTestPlanContext(testPlans, NoticeConstants.Event.UPDATE);

View File

@ -5,7 +5,7 @@
<!--操作按钮-->
<div class="ms-opt-btn">
<el-button type="primary" size="small" @click="editScenario" title="ctrl + s">{{$t('commons.save')}}</el-button>
<el-button id="inputDelay" type="primary" size="small" @click="editScenario" title="ctrl + s">{{$t('commons.save')}}</el-button>
</div>
<div class="tip">{{$t('test_track.plan_view.base_info')}}</div>
@ -834,6 +834,7 @@
return bodyUploadFiles;
},
editScenario() {
document.getElementById("inputDelay").focus(); // input
this.$refs['currentScenario'].validate((valid) => {
if (valid) {
this.setParameter();

View File

@ -270,22 +270,6 @@
openEnvironmentConfig(project) {
this.$refs.environmentConfig.open(project.id);
},
handleEvent(event) {
let enter = event.keyCode;
let ctrl = event.ctrlKey;
let shift = event.shiftKey;
let alt = event.altKey;
if(enter === 13 && ctrl && !shift && !alt) {
//ctrl + enter
this.form.description += '\n';
}
if(enter === 13 && !ctrl && shift && !alt) {
//shift + enter
}
if(enter === 13 && !ctrl && !shift && !alt) {
this.submit('form')
}
},
},
created() {
document.addEventListener('keydown', this.handleEvent)

View File

@ -257,7 +257,17 @@ export default {
statusChange(param) {
this.$post('/test/plan/edit', param, () => {
for (let i = 0; i < this.tableData.length; i++) {
if (this.tableData[i].id == param.id) {
if (this.tableData[i].id == param.id) { //
if (this.tableData[i].status !== "Completed" && param.status === "Completed") {
this.tableData[i].actualEndTime = new Date();
} // ->=null
else if (this.tableData[i].status !== "Underway" && param.status === "Underway") {
this.tableData[i].actualStartTime = new Date();
this.tableData[i].actualEndTime = "";
} // ->=null
else if (this.tableData[i].status !== "Prepare" && param.status === "Prepare") {
this.tableData[i].actualStartTime = this.tableData[i].actualEndTime = "";
} // ->=null
this.tableData[i].status = param.status;
break;
}

View File

@ -18,20 +18,12 @@
@click="dialogFormVisible=true">
{{ $t('report.test_stop_now') }}
</el-button>
<!-- <el-button :disabled="isReadOnly || report.status !== 'Completed'" type="success" plain size="mini"-->
<!-- @click="rerun(testId)">-->
<!-- {{ $t('report.test_execute_again') }}-->
<!-- </el-button>-->
<el-button :disabled="isReadOnly" type="info" plain size="mini" @click="handleExport(reportName)">
{{ $t('test_track.plan_view.export_report') }}
</el-button>
<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">
@ -159,7 +151,6 @@ export default {
this.testName = data.testName;
this.projectId = data.projectId;
this.projectName = data.projectName;
//
if (callback) callback(res);
} else {
this.$error(this.$t('report.not_exist'));

View File

@ -13,7 +13,6 @@
ref="nodeTree"/>
</template>
<!-- <ms-table-header :condition.sync="condition" @search="search" title="" :show-create="false"/>-->
<el-table
v-loading="result.loading"
@ -30,11 +29,6 @@
:label="$t('commons.name')"
show-overflow-tooltip>
</el-table-column>
<!-- <el-table-column-->
<!-- prop="userName"-->
<!-- :label="$t('load_test.user_name')"-->
<!-- show-overflow-tooltip>-->
<!-- </el-table-column>-->
<el-table-column
prop="status"
column-key="status"

View File

@ -48,14 +48,6 @@
<span>{{ scope.row.createTime | timestampFormatDate }}</span>
</template>
</el-table-column>
<!-- <el-table-column-->
<!-- sortable-->
<!-- prop="updateTime"-->
<!-- :label="$t('commons.update_time')">-->
<!-- <template v-slot:default="scope">-->
<!-- <span>{{ scope.row.updateTime | timestampFormatDate }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column
prop="status"
column-key="status"
@ -143,9 +135,6 @@ export default {
status: 'default',
screenHeight: document.documentElement.clientHeight - 330,//
buttons: [
// {
// name: "", handleClick: this.handleBatchEdit
// },
{
name: this.$t('test_track.plan.load_case.unlink_in_bulk'), handleClick: this.handleDeleteBatch
},
@ -238,9 +227,6 @@ export default {
this.selectRows.add(row);
}
},
// handleBatchEdit() {
//
// },
handleDeleteBatch() {
this.$alert(this.$t('test_track.plan_view.confirm_cancel_relevance') + "", '', {
confirmButtonText: this.$t('commons.confirm'),
@ -325,7 +311,6 @@ export default {
this.$refs.loadCaseReport.drawer = true;
} else {
this.$warning(this.$t('test_track.plan.load_case.report_not_found'));
// this.initTable();
}
})
},

View File

@ -5,7 +5,7 @@
:show-create="false"
:tip="$t('commons.search_by_name_or_id')">
<template v-slot:title>
性能用例
{{ $t('test_track.plan.load_case.case') }}
</template>
<template v-slot:button>
<ms-table-button :is-tester-permission="true" icon="el-icon-connection"

View File

@ -1 +1 @@
export const PHONE_REGEX = '^1(3|4|56|7|8|9)\\d{9}$';
export const PHONE_REGEX = '^1(3|4|5|6|7|8|9)\\d{9}$';

View File

@ -1131,6 +1131,7 @@ export default {
plan_delete_tip: "The test plan is under way, please confirm and delete it!",
plan_delete: "Delete test plan",
load_case: {
case: "Load Case",
execution_status: "Execution status",
report: "report",
view_report: "View report",

View File

@ -1135,6 +1135,7 @@ export default {
plan_delete_tip: "该测试计划正在进行中,请确认再删除!",
plan_delete: "删除计划",
load_case: {
case: "性能用例",
execution_status: "执行状态",
report: "报告",
view_report: "查看报告",

View File

@ -1133,6 +1133,7 @@ export default {
plan_delete_tip: "該測試計劃正在進行中,請確認再刪除!",
plan_delete: "刪除計劃",
load_case: {
case: "性能用例",
execution_status: "執行狀態",
report: "報告",
view_report: "查看報告",