refactor(测试计划): 性能测试用例优化

This commit is contained in:
shiziyuan9527 2021-01-19 15:42:08 +08:00
parent 097ab76a70
commit 0b128343ef
3 changed files with 22 additions and 26 deletions

View File

@ -18,10 +18,10 @@
@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 || 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>

View File

@ -193,19 +193,17 @@ export default {
}
this.$post("/test/plan/load/case/list/" + this.currentPage + "/" + this.pageSize, param, response => {
let data = response.data;
this.total = data.itemCount;
this.tableData = data.listObject;
let {itemCount, listObject} = data;
this.total = itemCount;
this.tableData = listObject;
})
},
refreshStatus() {
this.refreshScheduler = setInterval(() => {
let arr = this.tableData.filter(data => data.status !== 'Completed' && data.status !== 'Error' && data.status !== "Saved");
if (arr.length > 0) {
this.initTable();
} else {
clearInterval(this.refreshScheduler);
}
}, 4000);
//
let arr = this.tableData.filter(data => data.status !== 'Completed' && data.status !== 'Error' && data.status !== 'Saved');
arr.length > 0 ? this.initTable() : clearInterval(this.refreshScheduler);
}, 8000);
},
handleSelectAll(selection) {
if (selection.length > 0) {
@ -263,20 +261,18 @@ export default {
testPlanLoadId: loadCase.id,
triggerMode: 'CASE'
}).then(() => {
this.$notify({
this.$notify.success({
title: loadCase.caseName,
message: this.$t('test_track.plan.load_case.exec'),
type: 'success'
message: this.$t('test_track.plan.load_case.exec').toString()
});
this.initTable();
}).catch(() => {
//todo
this.$post('/test/plan/load/case/update', {id: loadCase.id, status: "error"}, () => {
this.initTable();
});
this.$notify.error({
title: loadCase.caseName,
message: this.$t('test_track.plan.load_case.error')
message: this.$t('test_track.plan.load_case.error').toString()
});
})
},
@ -289,15 +285,15 @@ export default {
},
sort(column) {
//
if (this.condition.orders) {
this.condition.orders = [];
}
_sort(column, this.condition);
this.initTableData();
// if (this.condition.orders) {
// this.condition.orders = [];
// }
// _sort(column, this.condition);
// this.initTable();
},
filter(filters) {
_filter(filters, this.condition);
this.initTableData();
// _filter(filters, this.condition);
// this.initTable();
},
getReport(data) {
const {loadReportId} = data;

View File

@ -226,7 +226,7 @@ export default {
if (response.success) {
this.projects = response.data.filter(da => da.id !== getCurrentProjectID());
} else {
this.$warning()(response.message);
this.$warning(response.message);
}
});
},