Browse Source

回归测试

master
陈裕财 3 years ago
parent
commit
eb8e5d1f72
  1. 1
      src/api/xm/core/xmQuestion.js
  2. 318
      src/views/xm/rpt/product/questionRetestDist.vue
  3. 10
      src/views/xm/rpt/reportIndex.vue

1
src/api/xm/core/xmQuestion.js

@ -41,6 +41,7 @@ export const getXmQuestionAttDist = params => { return axios.get(`${base}/xm/cor
export const getXmQuestionAgeDist = params => { return axios.get(`${base}/xm/core/xmQuestion/getXmQuestionAgeDist`, { params: params }); };
export const getXmQuestionSort = params => { return axios.get(`${base}/xm/core/xmQuestion/getXmQuestionSort`, { params: params }); };
export const getXmQuestionRetestDist = params => { return axios.get(`${base}/xm/core/xmQuestion/getXmQuestionRetestDist`, { params: params }); };

318
src/views/xm/rpt/product/questionRetestDist.vue

@ -0,0 +1,318 @@
<template>
<section>
<el-dialog fullscreen :title="dialogTitle" append-to-body modal-append-to-body width="80%" top="20px" :visible.sync="visible">
<el-row :gutter="5">
<el-col :span="18">
<div>
<div class="main" id="xmQuestionRetestDist"
style="width:100%;height:600px;margin:0 auto;"></div>
<div class="progress"></div>
</div>
</el-col>
<el-col :span="6" class="border padding">
<el-form :model="filters">
<el-form-item label="归属产品" >
<xm-product-select v-if="!xmProductCpd || !xmProductCpd.id" ref="xmProductSelect" style="display:inline;" :auto-select="false" :link-project-id="xmProject?xmProject.id:null" @row-click="onProductSelected" :iterationId="xmIteration?xmIteration.id:null" @clear="onProductClear"></xm-product-select>
<span v-else>{{xmProductCpd.id}} <span v-if="xmProductCpd.productName"><br/>{{ xmProductCpd.productName }} </span> </span>
</el-form-item>
<el-form-item label="归属迭代" v-if="xmIteration && xmIteration.id">
<span> {{xmIteration.id}}
<span v-if="xmIteration.iterationName"><br/>{{ xmIteration.iterationName }} </span>
</span>
</el-form-item>
<el-form-item label="归属迭代" v-else-if="filters.product && filters.product.id">
<xm-iteration-select ref="xmIterationSelect" :auto-select="false" :product-id="filters.product?filters.product.id:null" :link-project-id="xmProject?xmProject.id:null" placeholder="迭代" @row-click="onIterationSelected" @clear="onIterationClear"></xm-iteration-select>
</el-form-item>
<el-form-item label="缺陷状态" prop="bugStatus">
<el-select v-model="filters.bugStatus" @change="onXmQuestionSomeFieldsChange('bugStatus',$event)" clearable>
<el-option v-for="i in this.dicts.bugStatus" :label="i.name" :key="i.id" :value="i.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="缺陷类型" prop="bugType" >
<el-select v-model="filters.bugType" @change="onXmQuestionSomeFieldsChange('bugType',$event)" clearable>
<el-option v-for="i in this.dicts.bugType" :label="i.name" :key="i.id" :value="i.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="缺陷原因" prop="bugReason">
<el-select v-model="filters.bugReason" @change="onXmQuestionSomeFieldsChange('bugReason',$event)" clearable>
<el-option v-for="i in this.dicts.bugReason" :label="i.name" :key="i.id" :value="i.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="严重程度" prop="bugSeverity" >
<el-select v-model="filters.bugSeverity" @change="onXmQuestionSomeFieldsChange('bugSeverity',$event)" clearable>
<el-option v-for="i in this.dicts.bugSeverity" :label="i.name" :key="i.id" :value="i.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="优先级" prop="priority" >
<el-select v-model="filters.priority" @change="onXmQuestionSomeFieldsChange('priority',$event)" clearable>
<el-option v-for="i in dicts.priority" :label="i.name" :key="i.id" :value="i.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="解决方案" prop="solution" >
<el-select v-model="filters.solution" @change="onXmQuestionSomeFieldsChange('solution',$event)" clearable>
<el-option v-for="i in dicts.bugSolution" :label="i.name" :key="i.id" :value="i.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="重现频率" prop="repRate" >
<el-select v-model="filters.repRate" @change="onXmQuestionSomeFieldsChange('repRate',$event)" clearable>
<el-option v-for="i in dicts.bugRepRate" :label="i.name" :key="i.id" :value="i.id"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="searchXmQuestionRetestDist">查询</el-button>
</el-form-item>
</el-form>
</el-col>
</el-row>
</el-dialog>
</section>
</template>
<script>
import util from '@/common/js/util';//
import { initSimpleDicts } from '@/api/mdp/meta/item';//
import { mapGetters } from 'vuex'
import { getXmQuestionRetestDist } from '@/api/xm/core/xmQuestion';
import XmProductSelect from '@/views/xm/core/components/XmProductSelect';//
import XmIterationSelect from '@/views/xm/core/components/XmIterationSelect';//
export default {
components: {
XmIterationSelect,XmProductSelect,
},
props:['xmProduct','xmIteration','xmProject'],
computed: {
...mapGetters([
'userInfo','roles'
]),
xmQuestionRetestsCpd(){
if(this.xmQuestionRetests.length==0){
return []
}else{
var datas=[]
this.xmQuestionRetests.forEach(i=>{
var data={}
if(i.retimes>5){
data.name="5次以上"
}else{
data.name=this.legendCpd[i.retimes]
}
data.value=i.bugsNum
datas.push(data)
})
return datas;
}
},
title(){
return '缺陷回归测试数量分布'
},
legendCpd(){
return ["1次","2次","3次","4次","5次","5次以上"]
},
dialogTitle(){
if(this.xmIteration && this.xmIteration.id){
return (this.xmIteration?'迭代【'+this.xmIteration.iterationName+'】':'')+'缺陷回归分布'
}else {
return (this.filters.product?'产品【'+this.filters.product.productName+'】':'')+'缺陷回归分布'
}
},
xmProductCpd(){
if(this.xmIteration && this.xmIteration.id){
return {id:this.xmIteration.productId,productName:this.xmIteration.productName}
}
if(this.xmProduct && this.xmProduct.id){
return this.xmProduct
}
return null;
}
},
watch: {
xmQuestionRetestsCpd(){
this.drawCharts();
}
},
data() {
return {
filters:{
product:null,
iteration:null,
},
groupBy:'handler_userid',
groupBys:[
{id:'create_userid', name:'创建人'},
{id:'ask_userid', name:'提出人'},
{id:'handler_userid', name:'负责人'},
{id:'menu_id', name:'故事'},
],
dicts:{},// params=[{categoryId:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}
load:{ list: false, edit: false, del: false, add: false },//...
dateRanger:[],
maxTableHeight:300,
visible:false,
xmQuestionRetests:[],
pageInfo: {
//
total: 0, //0>0
pageSize: 20, //
count:true, //
pageNum: 1, //1
orderFields: ["value"], // ['sex','student_id']
orderDirs: ["desc"], // asc,desc ['asc','desc']
},
}//end return
},//end data
methods: {
open(params){
this.visible=true;
this.filters.product=params.xmProduct
this.filters.project=params.xmProject
this.filters.iteration=params.xmIteration
if((this.filters.product && this.filters.product.id) || ( this.filters.iteration && this.filters.iteration.id)){
this.searchXmQuestionRetestDist()
}
},
drawCharts() {
this.myChart = this.$echarts.init(document.getElementById("xmQuestionRetestDist"));
this.myChart.setOption(
{
title: {
text: this.title,
left: 'center'
},
tooltip: {
trigger: 'item'
},
legend: {
top:'5%',
left: 'center',
data:this.legendCpd,
},
series: [
{
type: 'pie',
radius: '50%',
data: this.xmQuestionRetestsCpd,
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
},
label: {
show: true,
position: 'center'
},
}
]
}
)
},
onXmQuestionSomeFieldsChange(fieldName,$event){
this.xmQuestionRetests=[]
},
searchXmQuestionRetestDist(){
if(!this.groupBy){
this.$notify({position:'bottom-left',showClose:true,message:'请选中分组属性',type:'warning'})
return
}
let params = {
pageSize: this.pageInfo.pageSize,
pageNum: this.pageInfo.pageNum,
total: this.pageInfo.total,
count: this.pageInfo.count,
};
if(this.filters.solution){
params.solution=this.filters.solution
}
if(this.filters.bugType){
params.bugType=this.filters.bugType
}
if(this.filters.bugStatus){
params.bugStatus=this.filters.bugStatus
}
if(this.filters.bugReason){
params.bugReason=this.filters.bugReason
}
if(this.filters.bugSeverity){
params.bugSeverity=this.filters.bugSeverity
}
if(this.filters.repRate){
params.repRate=this.filters.repRate
}
if(this.filters.priority){
params.priority=this.filters.priority
}
params.groupBy=this.groupBy
if(this.filters.product){
params.productId=this.filters.product.id
}
if(this.filters.iteration){
params.iterationId=this.filters.iteration.id
}
if (
this.pageInfo.orderFields != null &&
this.pageInfo.orderFields.length > 0
) {
let orderBys = [];
for (var i = 0; i < this.pageInfo.orderFields.length; i++) {
orderBys.push(
this.pageInfo.orderFields[i] + " " + this.pageInfo.orderDirs[i]
);
}
params.orderBy = orderBys.join(",");
}
getXmQuestionRetestDist(params).then(res=>{
this.xmQuestionRetests=res.data.data
})
},
onProductSelected(product){
this.filters.product=product
},
onProductClear(){
this.filters.product=null
},
onIterationSelected(iteration){
this.filters.iteration=iteration
},
onIterationClear(){
this.filters.iteration=null
}
},//end method
mounted() {
initSimpleDicts('all',['bugSeverity','bugSolution','bugStatus','bugType','priority','bugRepRate','bugReason'] ).then(res=>{
this.dicts=res.data.data;
})
//this.charts();
//this.drawCharts();
}//end mounted
}
</script>
<style scoped>
.image {
width: 100%;
display: block;
}
</style>

10
src/views/xm/rpt/reportIndex.vue

@ -48,6 +48,7 @@
<xm-question-att-dist ref="xmQuestionAttDist" :xm-product="xmProduct" :xm-project="xmProject" :xm-iteration="xmIteration"></xm-question-att-dist>
<xm-question-age-dist ref="xmQuestionAgeDist" :xm-product="xmProduct" :xm-project="xmProject" :xm-iteration="xmIteration"></xm-question-age-dist>
<xm-question-sort ref="xmQuestionSort" :xm-product="xmProduct" :xm-project="xmProject" :xm-iteration="xmIteration"></xm-question-sort>
<xm-question-retest-dist ref="xmQuestionRetestDist" :xm-product="xmProduct" :xm-project="xmProject" :xm-iteration="xmIteration"></xm-question-retest-dist>
<xm-product-work-item-day-list ref="xmProductWorkItemDayList" :xm-product="xmProduct" :xm-project="xmProject"></xm-product-work-item-day-list>
<xm-iteration-work-item-day-list ref="xmIterationWorkItemDayList" :xm-product="xmProduct" :xm-project="xmProject" :xm-iteration="xmIteration"></xm-iteration-work-item-day-list>
@ -91,6 +92,7 @@
import xmQuestionAttDist from './product/questionAttDist'
import xmQuestionAgeDist from './product/questionAgeDist'
import xmQuestionSort from './product/questionSort'
import xmQuestionRetestDist from './product/questionRetestDist'
import xmTestPlanCaseExecStatusDist from './testPlan/testPlanCaseExecStatusDist'
@ -109,7 +111,7 @@
xmIterationBurnout,xmMenuDayTrend,xmMenuDayAccumulate,xmMenuAttDist,xmMenuAgeDist,xmMenuSort,xmProductWorkItemDayList,xmTaskDayTrend,xmTaskDayAccumulate,xmTaskAttDist,xmTaskAgeDist,xmTaskSort,xmProjectWorkItemDayList,xmProjectWorkloadSetDayList,xmProjectWorkloadSetMonthList,xmQuestionDayTrend,xmQuestionDayAccumulate,xmQuestionAttDist,xmQuestionAgeDist,xmQuestionSort,
xmIterationXmMenuDayTrend,xmIterationXmMenuDayAccumulate,xmIterationWorkItemDayList,xmIterationXmQuestionDayTrend,xmIterationXmQuestionDayAccumulate,
xmTestPlanCaseExecStatusDist,xmTestPlanCaseUserDist
xmTestPlanCaseExecStatusDist,xmTestPlanCaseUserDist,xmQuestionRetestDist
},
props:['xmProduct','xmIteration','xmProject','xmTestCasedb','xmTestPlan'],
@ -194,14 +196,14 @@
{rptName:'测试用例执行状态分布',category:'测试计划级',ref:'xmTestPlanCaseExecStatusDist',desc:'按测试用例执行结果统计,通过、失败、忽略、阻塞',img:pieSimple },
{rptName:'测试用例执行用户分布',category:'测试计划级',ref:'xmTestPlanCaseUserDist',desc:'统计测试用例负责人用例执行情况',img:bar },
{rptName:'缺陷回归分布',category:'测试计划级',ref:'xmQuestionReTestingDist',desc:'跟踪新提出、执行中、已解决、已关闭状态的缺陷数量按日期变化趋势,识别缺陷处理工作情况',img:lineStack },
{rptName:'缺陷回归分布',category:'测试计划级',ref:'xmQuestionRetestDist',desc:'统计项目中缺陷在回归测试中分布情况,跟踪缺陷的重新打开率;',img:lineStack },
{rptName:'测试次数每日统计',category:'测试计划级',ref:'xmTestDayTimesCalc',desc:'跟踪新提出、执行中、已解决、已关闭状态的缺陷数量按日期变化趋势,识别缺陷处理工作情况',img:lineStack },
{rptName:'缺陷状态分布',category:'测试计划级',ref:'xmQuestionStateDist',desc:'跟踪新提出、执行中、已解决、已关闭状态的缺陷数量按日期变化趋势,识别缺陷处理工作情况',img:lineStack },
{rptName:'缺陷每日趋势',category:'测试计划级',ref:'xmQuestionDayTrend',desc:'跟踪新提出、执行中、已解决、已关闭状态的缺陷数量按日期变化趋势,识别缺陷处理工作情况',img:lineStack },
{rptName:'缺陷每日累积',category:'测试计划级',ref:'xmQuestionDayAccumulate',desc:'跟踪新提出、执行中、已解决、已关闭状态的缺陷数量按日期累积情况,识别缺陷处理工作的瓶颈',img:areaStack },
{rptName:'缺陷每日累积',category:'测试计划级',ref:'xmQuestionDayAccumulate',desc:'跟踪一段时间内,各种程度和类别的缺陷累积情况,监控缺陷的变化趋势',img:areaStack },
{rptName:'缺陷属性分布',category:'测试计划级',ref:'xmQuestionAttDist',desc:'统计所有缺陷任意属性数量分布情况(实时数据)',img:pieSimple },
{rptName:'缺陷年龄分布',category:'测试计划级',ref:'xmQuestionAgeDist',desc:'统计所有缺陷年龄分布情况(实时数据)',img:pieSimple },
{rptName:'缺陷年龄分布',category:'测试计划级',ref:'xmQuestionAgeDist',desc:'统计所有缺陷按照年龄的分布情况,跟踪缺陷的生命周期和响应情况',img:pieSimple },
{rptName:'缺陷提出人排行榜',category:'测试计划级',ref:'xmQuestionAskUserSort',desc:'从缺陷提出人、创建人、负责人、故事等维度统计缺陷数量排行榜(实时数据)',img:bar },
{rptName:'缺陷负责人排行榜',category:'测试计划级',ref:'xmQuestionHandlerUserSort',desc:'从缺陷提出人、创建人、负责人、故事等维度统计缺陷数量排行榜(实时数据)',img:bar },
{rptName:'缺陷模块排行榜',category:'测试计划级',ref:'xmQuestionSort',desc:'从缺陷提出人、创建人、负责人、故事等维度统计缺陷数量排行榜(实时数据)',img:bar },

Loading…
Cancel
Save