Browse Source

优化测试设计与执行

master
陈裕财 4 years ago
parent
commit
ebe3dbeaab
  1. 2
      src/router/routes_xm.js
  2. 10
      src/views/xm/core/xmMenu/XmMenuEdit.vue
  3. 25
      src/views/xm/core/xmQuestion/XmQuestionAdd.vue
  4. 32
      src/views/xm/core/xmTestCase/XmTestCaseAdd.vue
  5. 4
      src/views/xm/core/xmTestCase/XmTestCaseEdit.vue
  6. 109
      src/views/xm/core/xmTestCase/XmTestCaseMng.vue
  7. 2
      src/views/xm/core/xmTestCaseExec/XmTestCaseExecMng.vue

2
src/router/routes_xm.js

@ -54,7 +54,7 @@ export default {
{ path: 'xmQuestion/XmQuestionMng', component: _import('xm/core/xmQuestion/XmQuestionMng'), name: 'XmQuestionMng', meta: { title: '缺陷管理' }},
{ path: 'xmQuestion/XmQuestionMngMy', component: _import('xm/core/xmQuestion/XmQuestionMngMy'), name: 'XmQuestionMngMy', meta: { title: '我的缺陷' }},
{ path: 'xmTestCase/XmTestCaseMng', component: _import('xm/core/xmTestCase/XmTestCaseMng'), name: 'XmTestCaseMng', meta: { title: '测试设计' }},
{ path: 'xmTestCaseExec/XmTestCaseExecMng', component: _import('xm/core/xmTestCaseExec/XmTestCaseExecMng'), name: 'XmTestCaseExecMng', meta: { title: '测试执行' }},
//{ path: 'xmTestCaseExec/XmTestCaseExecMng', component: _import('xm/core/xmTestCaseExec/XmTestCaseExecMng'), name: 'XmTestCaseExecMng', meta: { title: '测试执行' }},
{ path: 'xmQuestion/XmQuestionDetailRoute', component: _import('xm/core/xmQuestion/XmQuestionDetailRoute'), name: 'XmQuestionDetailRoute', meta: { title: '缺陷明细' },hidden:true},
]

10
src/views/xm/core/xmMenu/XmMenuEdit.vue

@ -145,6 +145,10 @@
<el-input-number :disabled="editForm.calcType!=='2' " style="width:200px;" v-model="editForm.actWorkload" :precision="2" :step="8" :min="0" placeholder="实际工时(小时)"></el-input-number> &nbsp;h
</el-form-item>
</el-tab-pane>
<el-tab-pane label="测试案例" name="62">
<xm-test-case-mng v-if="activateTabPaneName=='62'" :xm-product="{id:editForm.productId,productName:editForm.productName}" :xm-menu="editForm"></xm-test-case-mng>
</el-tab-pane>
<el-tab-pane label="成本" name="3">
<el-form-item label="预估金额" prop="budgetAt">
<el-input-number :disabled="editForm.calcType!=='2' " style="width:200px;" v-model="editForm.budgetAt" :precision="2" :step="100" :min="0" placeholder="预算金额"></el-input-number>
@ -209,13 +213,14 @@
import {listXmMenuWithState,editXmMenu,editXmMenuSomeFields } from '@/api/xm/core/xmMenu';
import { mapGetters } from 'vuex'
import UsersSelect from "@/views/mdp/sys/user/UsersSelect";
import XmMenuOverview from './XmMenuOverview.vue';
import XmMenuExchangeMng from '../xmMenuExchange/XmMenuExchangeMng.vue';
import XmMenuOverview from './XmMenuOverview.vue';
import XmMenuExchangeMng from '../xmMenuExchange/XmMenuExchangeMng.vue';
import TagMng from "@/views/mdp/arc/tag/TagMng";
import XmSubWorkItem from "@/views/xm/core/xmMenuWorkItem/XmSubWorkItem";
import XmRecord from '../xmRecord/XmRecord'
import XmMyDoFocus from '@/views/myWork/my/components/DoFocus';
import ArchiveEdit from '@/views/xm/core/wiki/archive/WikiMenuEdit';
import XmTestCaseMng from '@/views/xm/core/xmTestCase/XmTestCaseMng';
export default {
computed: {
@ -523,6 +528,7 @@ import XmMenuExchangeMng from '../xmMenuExchange/XmMenuExchangeMng.vue';
XmRecord,
XmMyDoFocus,
ArchiveEdit,
XmTestCaseMng,
},
mounted() {

25
src/views/xm/core/xmQuestion/XmQuestionAdd.vue

@ -9,7 +9,7 @@
<el-col :span="8">
<el-form-item label="归属项目" prop="projectId">
<font v-if="filters.selProject">{{this.filters.selProject?this.filters.selProject.name:''}}</font>
<xm-project-select ref="xmProjectSelect" v-if="!selProject" @row-click="onPorjectConfirm"></xm-project-select>
<xm-project-select ref="xmProjectSelect" v-if="!selProject" @row-click="onPorjectConfirm" :auto-select="false"></xm-project-select>
</el-form-item>
</el-col>
<el-col :span="8">
@ -182,7 +182,7 @@
}
},
props:['xmQuestion','visible',"selProject",'qtype','xmTestCaseExec','xmTestCase','xmProduct'],
props:['xmQuestion','visible',"selProject",'qtype','xmTestCase','xmTestCase','xmProduct'],
watch: {
'xmQuestion':function( xmQuestion ) {
this.addForm=Object.assign(this.addForm, this.xmQuestion);
@ -198,7 +198,7 @@
}
this.addForm.id=sn()
this.initByExec();
this.initByCase();
}
},
@ -450,18 +450,15 @@
this.addForm.projectId=''
this.addForm.projectName=''
},
initByExec(){
if(this.xmTestCaseExec){
this.addForm.caseExecId=this.xmTestCaseExec.id
this.addForm.caseName=this.xmTestCaseExec.caseName
this.addForm.caseId=this.xmTestCaseExec.caseId
initByCase(){
if(this.xmTestCase){
this.addForm.caseName=this.xmTestCase.caseName
this.addForm.caseId=this.xmTestCase.id
this.addForm.opStep=this.xmTestCase.testStep
this.addForm.expectResult=this.xmTestCase.expectResult
this.addForm.menuId=this.xmTestCaseExec.menuId
this.addForm.menuName=this.xmTestCaseExec.menuName
this.addForm.taskId=this.xmTestCaseExec.taskId
this.addForm.taskName=this.xmTestCaseExec.taskName
this.addForm.name=this.xmTestCaseExec.caseName
this.addForm.menuId=this.xmTestCase.menuId
this.addForm.menuName=this.xmTestCase.menuName
this.addForm.name=this.xmTestCase.caseName
}
}
@ -482,7 +479,7 @@
}
this.addForm.qtype=this.qtype
this.setDefaultData();
this.initByExec();
this.initByCase();
initSimpleDicts('all',['bugSeverity','bugSolution','bugStatus','bugType','priority','bugRepRate']).then(res=>{
if(res.data.tips.isOk){
this.dicts['bugSeverity']=res.data.data.bugSeverity

32
src/views/xm/core/xmTestCase/XmTestCaseAdd.vue

@ -16,13 +16,13 @@
</el-form-item>
<el-form-item label="测试步骤" prop="testStep">
<vue-editor :id="'testStep3'" :branch-id="userInfo.branchId" v-model="addForm.testStep" ref="testStep" key="1"></vue-editor>
<vue-editor v-if="visible" :id="'testStep3'" :branch-id="userInfo.branchId" v-model="addForm.testStep" ref="testStep" key="1"></vue-editor>
</el-form-item>
<el-form-item label="预期结果" prop="expectResult">
<vue-editor :id="'expectResult3'" :branch-id="userInfo.branchId" v-model="addForm.expectResult" ref="expectResult" key="2"></vue-editor>
<vue-editor v-if="visible" :id="'expectResult3'" :branch-id="userInfo.branchId" v-model="addForm.expectResult" ref="expectResult" key="2"></vue-editor>
</el-form-item>
<el-form-item>
@ -34,7 +34,7 @@
</el-form>
<el-drawer append-to-body title="需求选择" :visible.sync="menuVisible" size="60%" :close-on-click-modal="false">
<xm-menu-select :visible="menuVisible" checkScope="3" :is-select-menu="true" :multi="true" @menus-selected="onSelectedMenus" ></xm-menu-select>
<xm-menu-select :xm-product="xmProduct" :visible="menuVisible" checkScope="3" :is-select-menu="true" :multi="true" @menus-selected="onSelectedMenus" ></xm-menu-select>
</el-drawer>
</el-row>
</section>
@ -56,7 +56,7 @@
'userInfo','roles'
])
},
props:['xmTestCase','visible'],
props:['xmTestCase','visible','xmProduct','xmMenu'],
watch: {
'xmTestCase':function( xmTestCase ) {
//this.addForm = xmTestCase;
@ -64,6 +64,18 @@
'visible':function(visible) {
if(visible==true){
//
if(this.xmProduct && this.xmProduct.id){
this.addForm.productId=this.xmProduct.id
}else{
this.addForm.productId=''
}
if(this.xmMenu && this.xmMenu.menuId){
this.addForm.menuId=this.xmMenu.menuId
this.addForm.menuName=this.xmMenu.menuName
}else{
this.addForm.menuId=''
this.addForm.menuName=''
}
}
}
},
@ -148,6 +160,18 @@
xmMenuSelect,VueEditor
},
mounted() {
if(this.xmProduct && this.xmProduct.id){
this.addForm.productId=this.xmProduct.id
}else{
this.addForm.productId=''
}
if(this.xmMenu && this.xmMenu.menuId){
this.addForm.menuId=this.xmMenu.menuId
this.addForm.menuName=this.xmMenu.menuName
}else{
this.addForm.menuId=''
this.addForm.menuName=''
}
//this.addForm=Object.assign(this.addForm, this.xmTestCase);
/**在下面写其它函数***/

4
src/views/xm/core/xmTestCase/XmTestCaseEdit.vue

@ -20,13 +20,13 @@
</el-form-item>
<el-form-item label="测试步骤" prop="testStep">
<vue-editor :id="'testStep3'" :branch-id="userInfo.branchId" v-model="editForm.testStep" ref="testStep" key="1"></vue-editor>
<vue-editor v-if="visible" :id="'testStep3'" :branch-id="userInfo.branchId" v-model="editForm.testStep" ref="testStep" key="1"></vue-editor>
</el-form-item>
<el-form-item label="预期结果" prop="expectResult">
<vue-editor :id="'expectResult3'" :branch-id="userInfo.branchId" v-model="editForm.expectResult" ref="expectResult" key="2"></vue-editor>
<vue-editor v-if="visible" :id="'expectResult3'" :branch-id="userInfo.branchId" v-model="editForm.expectResult" ref="expectResult" key="2"></vue-editor>
</el-form-item>
<el-form-item>

109
src/views/xm/core/xmTestCase/XmTestCaseMng.vue

@ -3,9 +3,12 @@
<el-row>
<div>
<xm-product-select style="display:inline;" :auto-select="false" :link-project-id="filters.selProject?filters.selProject.id:null" @row-click="onProductSelected" @clear="filters.xmProduct=null"></xm-product-select>
<xm-product-select v-if="!xmProduct || !xmProduct.id" style="display:inline;" :auto-select="false" :link-project-id="filters.selProject?filters.selProject.id:null" @row-click="onProductSelected" @clear="filters.product=null"></xm-product-select>
<xm-iteration-select style="display:inline;" :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>
<span v-if="!xmMenu||!xmMenu.menuId">
<el-button v-if=" !filters.menus || filters.menus.length==0" @click="showMenu"> 选择需求</el-button>
<el-tag v-else closable @close=" clearFiltersMenu(filters.menus[0])">{{filters.menus[0].menuName.substr(0,5)}}({{filters.menus.length}})</el-tag>
</span>
<el-input v-model="filters.key" style="width: 20%;" placeholder="模糊查询">
<template slot="append">
<el-button type="primary" v-loading="load.list" :disabled="load.list==true" v-on:click="searchXmTestCases" icon="el-icon-search"></el-button>
@ -17,8 +20,8 @@
width="400"
trigger="click" >
<el-row>
<el-col :span="24" style="padding-top:5px;">
<xm-product-select :auto-select="false" :link-project-id="filters.selProject?filters.selProject.id:null" @row-click="onProductSelected" @clear="filters.xmProduct=null"></xm-product-select>
<el-col :span="24" style="padding-top:5px;" v-if="!xmProduct || !xmProduct.id">
<xm-product-select :auto-select="false" :link-project-id="filters.selProject?filters.selProject.id:null" @row-click="onProductSelected" @clear="filters.product=null"></xm-product-select>
</el-col>
<el-col :span="24" style="padding-top:5px;" v-if="!selProject" >
<xm-project-select :auto-select="false" :link-product-id="filters.product?filters.product.id:null" @row-click="onPorjectConfirm" @clear="filters.selProject=null"></xm-project-select>
@ -91,9 +94,9 @@
</template>
</el-table-column>
<el-table-column v-if="!multiSelect" label="操作" width="160" fixed="right">
<template scope="scope">
<el-button type="primary" @click="showEdit( scope.row,scope.$index)" icon="el-icon-edit"></el-button>
<el-button type="danger" @click="handleDel(scope.row,scope.$index)" icon="el-icon-delete"></el-button>
<template scope="scope">
<el-button type="text" @click="showAddBug(scope.row,scope.$index)" icon="el-icon-plus">bug</el-button>
<el-button type="text" @click="showBugs(scope.row,scope.$index)" icon="el-icon-s-data">查bug</el-button>
</template>
</el-table-column>
</el-table>
@ -106,15 +109,23 @@
<!--新增 XmTestCase 测试用例界面-->
<el-drawer title="新增测试用例" :visible.sync="addFormVisible" size="60%" append-to-body :close-on-click-modal="false">
<xm-test-case-add :xm-test-case="addForm" :visible="addFormVisible" @cancel="addFormVisible=false" @submit="afterAddSubmit"></xm-test-case-add>
<xm-test-case-add :xm-product="filters.product" :xm-menu="xmMenu" :xm-test-case="addForm" :visible="addFormVisible" @cancel="addFormVisible=false" @submit="afterAddSubmit"></xm-test-case-add>
</el-drawer>
<el-drawer title="选中用户" :visible.sync="selectUserForFiltersVisible" size="60%" append-to-body :close-on-click-modal="false">
<xm-group-mng v-if="filters.selProject" :sel-project=" filters.selProject " :is-select-single-user="1" @user-confirm="onFiltersUserConfirm"></xm-group-mng>
</el-drawer>
</el-row>
<el-drawer append-to-body title="需求选择" :visible.sync="menuVisible" size="60%" :close-on-click-modal="false">
<xm-menu-select :visible="menuVisible" :is-select-menu="true" :multi="true" @menus-selected="onSelectedMenus" ></xm-menu-select>
<xm-menu-select :xm-product="filters.product" :visible="menuVisible" :is-select-menu="true" :multi="true" @menus-selected="onSelectedMenus" ></xm-menu-select>
</el-drawer>
<el-dialog title="缺陷列表" :visible.sync="bugsVisible" width="80%" top="20px" append-to-body :close-on-click-modal="false">
<xm-question-mng v-if="bugsVisible" :xm-test-case="editForm" :sel-project="filters.selProject" :visible="bugsVisible" @cancel="bugsVisible=false" ></xm-question-mng>
</el-dialog>
<!--新增 XmQuestion xm_question界面-->
<el-dialog title="新增缺陷" :visible.sync="addBugVisible" width="80%" top="20px" append-to-body :close-on-click-modal="false">
<xm-question-add v-if="addBugVisible" :xm-test-case="editForm" :sel-project=" filters.selProject " :visible="addBugVisible" @cancel="addBugVisible=false"></xm-question-add>
</el-dialog>
</section>
</template>
@ -131,6 +142,9 @@
import XmProjectSelect from '@/views/xm/core/components/XmProjectSelect';
import XmGroupMng from '../xmGroup/XmGroupMng';
import XmQuestionMng from '../xmQuestion/XmQuestionMng';
import XmQuestionAdd from '../xmQuestion/XmQuestionAdd';
import XmIterationSelect from '@/views/xm/core/components/XmIterationSelect.vue';//
export default {
computed: {
@ -138,7 +152,25 @@
'userInfo','roles'
])
},
props:['multiSelect','selProject'],
props:['multiSelect','selProject','xmProduct','xmMenu'],
watch:{
'xmProduct.id':function(val){
if(this.xmProduct && this.xmProduct.id){
this.filters.product=this.xmProduct
}else{
this.filters.product=null
}
this.searchXmTestCases();
},
'xmMenu.menuId':function(val){
if(this.xmMenu && this.xmMenu.menuId){
this.filters.menus=[this.xmMenu]
}else{
this.filters.menus=[]
}
}
},
data() {
const beginDate = new Date();
const endDate = new Date();
@ -149,6 +181,7 @@
product:null,
selProject:null,
luser:null,
iteration:null,
},
xmTestCases: [],//
pageInfo:{//
@ -187,6 +220,8 @@
nextAction:'',
dateRanger: [ ],
pickerOptions: util.getPickerOptions('datarange'),
addBugVisible:false,
bugsVisible:false,
/**end 自定义属性请在上面加 请加备注**/
}
},//end data
@ -254,6 +289,9 @@
params.projectId=this.filters.selProject.id
}
if(this.filters.iteration){
params.iterationId=this.filters.iteration.id
}
if(this.filters.key){
params.key='%'+this.filters.key+'%'
}
@ -295,14 +333,7 @@
},
//xmTestCase
handleDel: function (row,index) {
if( !this.roles.some(i=>i.roleid=='testAdmin') && !this.roles.some(i=>i.roleid=='tester') && !this.roles.some(i=>i.roleid=='testTeamAdmin') ){
this.$notify({position:'bottom-left',showClose: true,message:"只有测试经理、测试组长、测试员可以操作",type:"error"});
return ;
}
if(!this.roles.some(i=>i.roleid=='testAdmin')){
this.$notify({position:'bottom-left',showClose:true,message: "只有测试管理员才能删除测试用例", type: 'error' });
return;
}
this.$confirm('确认删除该记录吗?', '提示', {
type: 'warning'
}).then(() => {
@ -321,14 +352,7 @@
},
//xmTestCase
batchDel: function () {
if( !this.roles.some(i=>i.roleid=='testAdmin') && !this.roles.some(i=>i.roleid=='tester') && !this.roles.some(i=>i.roleid=='testTeamAdmin') ){
this.$notify({position:'bottom-left',showClose: true,message:"只有测试经理、测试组长、测试员可以操作",type:"error"});
return ;
}
if(!this.roles.some(i=>i.roleid=='testAdmin')){
this.$notify({position:'bottom-left',showClose:true,message: "只有测试管理员才能删除测试用例", type: 'error' });
return;
}
this.$confirm('确认删除选中记录吗?', '提示', {
type: 'warning'
}).then(() => {
@ -429,19 +453,48 @@
setFiltersHandlerAsMySelf(){
this.filters.luser=this.userInfo;
this.searchXmTestCases();
}
},
showBugs(row){
this.editForm=row
this.bugsVisible=true;
},
showAddBug(row){
this.editForm=row
this.addBugVisible=true;
},
onIterationSelected(iteration){
this.filters.iteration=iteration
this.searchXmTestCases()
},
onIterationClear(){
this.filters.iteration=null
this.searchXmTestCases()
},
/**end 自定义函数请在上面加**/
},//end methods
components: {
'xm-test-case-add':XmTestCaseAdd,
'xm-test-case-edit':XmTestCaseEdit,
xmMenuSelect,XmProductSelect,XmProjectSelect,XmGroupMng
xmMenuSelect,XmProductSelect,XmProjectSelect,XmGroupMng,XmQuestionAdd,
XmQuestionMng,XmIterationSelect,
//
},
mounted() {
this.$nextTick(() => {
this.filters.luser=this.userInfo;
if(this.xmProduct && this.xmProduct.id){
this.filters.product=this.xmProduct
}else{
this.filters.product=null
}
if(this.xmMenu && this.xmMenu.menuId){
this.filters.menus=[this.xmMenu]
}else{
this.filters.menus=[]
}
this.getXmTestCases();
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el);
});

2
src/views/xm/core/xmTestCaseExec/XmTestCaseExecMng.vue

@ -740,7 +740,7 @@
mounted() {
this.filters.selProject=this.selProject;
this.filters.execUser=this.userInfo;
//this.filters.execUser=this.userInfo;
this.$nextTick(() => {
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el);
this.getXmTestCaseExecs();

Loading…
Cancel
Save