Commit 292e3857 authored by 黎博's avatar 黎博

Merge branch 'master' of git.quantgroup.cn:QA/qa-platform-ui

parents 2b145cb1 97197855
...@@ -5,7 +5,12 @@ const prodEnv = require('./prod.env') ...@@ -5,7 +5,12 @@ const prodEnv = require('./prod.env')
module.exports = merge(prodEnv, { module.exports = merge(prodEnv, {
NODE_ENV: '"development"', NODE_ENV: '"development"',
ENV_CONFIG: '"dev"', ENV_CONFIG: '"dev"',
QA_PLATFORM: '"//localhost:8082"', // QA_PLATFORM: '"//localhost:8082"',
TESTDATA_API: '"//testdata.liangkebang.com"', TESTDATA_API: '"//testdata.liangkebang.com"',
HOLMES: '"//localhost:8084"', // HOLMES: '"//localhost:8084"',
QA_PLATFORM: '"//qa-platform-fe.liangkebang.net/"',
HOLMES: '"//holmes-fe.liangkebang.net/"',
// HOLMES: '"//192.168.29.143:8084/"'
}) })
...@@ -4763,11 +4763,11 @@ ...@@ -4763,11 +4763,11 @@
} }
}, },
"echarts": { "echarts": {
"version": "4.8.0", "version": "4.9.0",
"resolved": "https://registry.npmjs.org/echarts/-/echarts-4.8.0.tgz", "resolved": "https://registry.npmjs.org/echarts/-/echarts-4.9.0.tgz",
"integrity": "sha512-YwShpug8fWngj/RlgxDaYrLBoD+LsZUArrusjNPHpAF+is+gGe38xx4W848AwWMGoi745t3OXM52JedNrv+F6g==", "integrity": "sha512-+ugizgtJ+KmsJyyDPxaw2Br5FqzuBnyOWwcxPKO6y0gc5caYcfnEUIlNStx02necw8jmKmTafmpHhGo4XDtEIA==",
"requires": { "requires": {
"zrender": "4.3.1" "zrender": "4.3.2"
} }
}, },
"editorconfig": { "editorconfig": {
...@@ -16991,9 +16991,9 @@ ...@@ -16991,9 +16991,9 @@
} }
}, },
"zrender": { "zrender": {
"version": "4.3.1", "version": "4.3.2",
"resolved": "https://registry.npmjs.org/zrender/-/zrender-4.3.1.tgz", "resolved": "https://registry.npmjs.org/zrender/-/zrender-4.3.2.tgz",
"integrity": "sha512-CeH2TpJeCdG0TAGYoPSAcFX2ogdug1K7LIn9UO/q9HWqQ54gWhrMAlDP9AwWYMUDhrPe4VeazQ4DW3msD96nUQ==" "integrity": "sha512-bIusJLS8c4DkIcdiK+s13HiQ/zjQQVgpNohtd8d94Y2DnJqgM1yjh/jpDb8DoL6hd7r8Awagw8e3qK/oLaWr3g=="
} }
} }
} }
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
}, },
"dependencies": { "dependencies": {
"axios": "^0.19.2", "axios": "^0.19.2",
"echarts": "^4.8.0", "echarts": "^4.9.0",
"element-ui": "^2.13.2", "element-ui": "^2.13.2",
"less": "^3.11.1", "less": "^3.11.1",
"sortablejs": "^1.13.0", "sortablejs": "^1.13.0",
......
import request from '@/utils/holmesRequest'
export function getReportList(queryInfo) {
return request({
url: '/auto/report/scene/batch/list',
method: 'get',
params: queryInfo
})
}
// 获取场景报告详情接口
export function getReportDetail(queryInfo) {
return request({
url: '/auto/report/scene/batch/detail',
method: 'get',
params: queryInfo
})
}
...@@ -28,6 +28,14 @@ import AddCase from '../views/auto/AddCase' ...@@ -28,6 +28,14 @@ import AddCase from '../views/auto/AddCase'
import SceneList from '../views/auto/SceneList' import SceneList from '../views/auto/SceneList'
import EditScene from '../views/auto/EditScene' import EditScene from '../views/auto/EditScene'
import RepayCallback from '../views/vcc/RepayCallback' import RepayCallback from '../views/vcc/RepayCallback'
// 添加报告页面
import ReportList from '../views/auto/ReportList'
import ReportDetail from '../views/auto/ReportDetail'
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
Vue.use(Router) Vue.use(Router)
const router = new Router({ const router = new Router({
...@@ -162,6 +170,17 @@ const router = new Router({ ...@@ -162,6 +170,17 @@ const router = new Router({
{ {
'path': '/vcc/repaycallback', 'path': '/vcc/repaycallback',
component: RepayCallback component: RepayCallback
},
// 添加报告
{
'path': '/auto/ReportList',
name: ReportList,
component: ReportList
},
{
'path': '/auto/ReportDetail',
name: ReportDetail,
component: ReportDetail
} }
] ]
} }
......
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
<el-button type="success" plain @click="AddRequestParamsListRow()" style="margin-top:10px" class="el-icon-circle-plus">添加行</el-button> <el-button type="success" plain @click="AddRequestParamsListRow()" style="margin-top:10px" class="el-icon-circle-plus">添加行</el-button>
</el-collapse-item> </el-collapse-item>
<!-- 参数列表 --> <!-- 参数列表 -->
<el-collapse-item name="3" title="参数列表"> <!-- <el-collapse-item name="3" title="参数列表">
<el-form-item> <el-form-item>
<el-row> <el-row>
<el-col :span="6"> <el-col :span="6">
...@@ -118,9 +118,9 @@ ...@@ -118,9 +118,9 @@
</el-row> </el-row>
</el-form-item> </el-form-item>
<el-button type="success" plain @click="AddParamsListRow()" style="mragin-top:10px" class="el-icon-circle-plus">添加行</el-button> <el-button type="success" plain @click="AddParamsListRow()" style="mragin-top:10px" class="el-icon-circle-plus">添加行</el-button>
</el-collapse-item> </el-collapse-item> -->
<!-- 响应解析列表 --> <!-- 响应解析列表 -->
<el-collapse-item name="4" title="响应提取"> <el-collapse-item name="3" title="响应提取">
<el-form-item> <el-form-item>
<el-row> <el-row>
<el-col :span="6"> <el-col :span="6">
...@@ -154,15 +154,15 @@ ...@@ -154,15 +154,15 @@
<el-button type="success" plain @click="AddResponseListRow()" style="mragin-top:10px" class="el-icon-circle-plus">添加行</el-button> <el-button type="success" plain @click="AddResponseListRow()" style="mragin-top:10px" class="el-icon-circle-plus">添加行</el-button>
</el-collapse-item> </el-collapse-item>
<!-- 断言 --> <!-- 断言 -->
<el-collapse-item name="5" title="结果断言"> <el-collapse-item name="4" title="结果断言">
<el-table :data="assertionList" border style="width:100%;margin-top: 15px;"> <el-table :data="assertionList" border style="width:100%;margin-top: 15px;">
<el-table-column label="表达式" width="350"> <el-table-column label="Json表达式" width="350">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.check"> <el-input v-model="scope.row.check">
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="断言" width="250"> <el-table-column label="比较符" width="250">
<template slot-scope="scope"> <template slot-scope="scope">
<el-select v-model="scope.row.comparator" placeholder="请选择"> <el-select v-model="scope.row.comparator" placeholder="请选择">
<el-option v-for="item in selectAssertionList" :key="item.id" :label="item.name" :value="item.id"></el-option> <el-option v-for="item in selectAssertionList" :key="item.id" :label="item.name" :value="item.id"></el-option>
...@@ -210,7 +210,6 @@ ...@@ -210,7 +210,6 @@
<script> <script>
import { getModulList, interfaceDetailList } from '@/api/getAotoInterface' import { getModulList, interfaceDetailList } from '@/api/getAotoInterface'
import { getInterfaceDetail, addCase, editCase } from '@/api/getAutoCase' import { getInterfaceDetail, addCase, editCase } from '@/api/getAutoCase'
// import bus from '@/utils/bus'
export default { export default {
data() { data() {
return { return {
...@@ -235,7 +234,6 @@ export default { ...@@ -235,7 +234,6 @@ export default {
interfaceName: '', interfaceName: '',
interfaceId: '', interfaceId: '',
headers: '', headers: '',
variables: '',
parameters: '', parameters: '',
extract: '', extract: '',
validate: '' validate: ''
...@@ -267,14 +265,14 @@ export default { ...@@ -267,14 +265,14 @@ export default {
] ]
}, },
isShow: false, isShow: false,
activeNames: '1', activeNames: ['1', '2', '3', '4'],
interfaceForm: { interfaceForm: {
interfaceId: '' interfaceId: ''
}, },
assertionList: [], assertionList: [],
headersList: [], headersList: [],
requestParamsList: [], requestParamsList: [],
paramsList: [], // paramsList: [],
responseList: [], responseList: [],
selectAssertionList: [ selectAssertionList: [
{ {
...@@ -308,7 +306,6 @@ export default { ...@@ -308,7 +306,6 @@ export default {
this.caseForm.interfaceId = '' this.caseForm.interfaceId = ''
this.headersList = [] this.headersList = []
this.requestParamsList = [] this.requestParamsList = []
this.paramsList = []
this.responseList = [] this.responseList = []
this.assertionList = [] this.assertionList = []
} else { } else {
...@@ -338,15 +335,6 @@ export default { ...@@ -338,15 +335,6 @@ export default {
paramsValue: newParamters[j] paramsValue: newParamters[j]
}) })
} }
// 参数列表
var newVariables = JSON.parse(row.variables)
this.paramsList = []
for (var k in newVariables) {
this.paramsList.push({
paramsName: k,
paramsValue: newVariables[k]
})
}
// 响应解析列表 // 响应解析列表
var newExtract = JSON.parse(row.extract) var newExtract = JSON.parse(row.extract)
this.responseList = [] this.responseList = []
...@@ -371,7 +359,6 @@ export default { ...@@ -371,7 +359,6 @@ export default {
}, },
// 模块下拉框改变事件 // 模块下拉框改变事件
selectChangeModel(selectItem) { selectChangeModel(selectItem) {
console.log(selectItem)
this.interfaceInfo.moduleId = selectItem this.interfaceInfo.moduleId = selectItem
interfaceDetailList(this.interfaceInfo).then((resp) => { interfaceDetailList(this.interfaceInfo).then((resp) => {
this.interfaceList = resp.data.data.list this.interfaceList = resp.data.data.list
...@@ -410,17 +397,6 @@ export default { ...@@ -410,17 +397,6 @@ export default {
requestParamsDel(index) { requestParamsDel(index) {
this.requestParamsList.splice(index, 1) this.requestParamsList.splice(index, 1)
}, },
// 参数列表
AddParamsListRow() {
this.paramsList.push({
paramsName: '',
paramsValue: ''
})
},
// 参数列表删除
paramsDel(index) {
this.paramsList.splice(index, 1)
},
// 添加响应解析列表 // 添加响应解析列表
AddResponseListRow() { AddResponseListRow() {
this.responseList.push({ this.responseList.push({
...@@ -440,14 +416,6 @@ export default { ...@@ -440,14 +416,6 @@ export default {
expect: '' expect: ''
}) })
}, },
// 断言改变
// changeState(e) {
// if (e === true) {
// this.assertionList.isRequired = e
// } else {
// this.assertionList.isRequired = e
// }
// },
// 断言删除 // 断言删除
AssertionDelete(index) { AssertionDelete(index) {
this.assertionList.splice(index, 1) this.assertionList.splice(index, 1)
...@@ -467,12 +435,6 @@ export default { ...@@ -467,12 +435,6 @@ export default {
requestParamsObj[item.paramsName] = item.paramsValue requestParamsObj[item.paramsName] = item.paramsValue
}) })
this.caseForm.parameters = JSON.stringify(requestParamsObj) this.caseForm.parameters = JSON.stringify(requestParamsObj)
// 参数列表
var paramsListObj = {}
this.paramsList.forEach((item) => {
paramsListObj[item.paramsName] = item.paramsValue
})
this.caseForm.variables = JSON.stringify(paramsListObj)
// 响应解析列表 // 响应解析列表
var responseObj = {} var responseObj = {}
this.responseList.forEach((item) => { this.responseList.forEach((item) => {
...@@ -514,6 +476,7 @@ export default { ...@@ -514,6 +476,7 @@ export default {
} }
} }
}) })
console.log('保存信息', this.caseForm)
}, },
// 取消按钮 // 取消按钮
cancelCaseFrom() { cancelCaseFrom() {
......
...@@ -180,7 +180,7 @@ export default { ...@@ -180,7 +180,7 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10
}, },
activeNames: '1', activeNames: ['1', '2', '3', '4'],
interfaceForm: { interfaceForm: {
id: '', id: '',
name: '', name: '',
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
</el-dialog> </el-dialog>
<!-- 编辑场景用例 --> <!-- 编辑场景用例 -->
<el-dialog title="编辑场景用例" :visible.sync="editDialogVisible" width="60%"> <el-dialog title="编辑场景用例" :visible.sync="editDialogVisible" width="60%">
<el-card> <!-- <el-card> -->
<el-form> <el-form>
<!-- <el-form-item label="用例名称:" style="width:310px;"> <!-- <el-form-item label="用例名称:" style="width:310px;">
<el-input v-model="caseForm.name" :disabled="true"></el-input> <el-input v-model="caseForm.name" :disabled="true"></el-input>
...@@ -137,8 +137,7 @@ ...@@ -137,8 +137,7 @@
<el-button type="success" plain @click="AddRequestParamsListRow()" class="el-icon-circle-plus">添加行</el-button> <el-button type="success" plain @click="AddRequestParamsListRow()" class="el-icon-circle-plus">添加行</el-button>
</el-collapse-item> </el-collapse-item>
<!-- 参数列表 --> <!-- 参数列表 -->
<el-collapse-item name="3" title="参数变量"> <!-- <el-collapse-item name="3" title="参数变量">
<el-form-item> <el-form-item>
<el-row> <el-row>
<el-col :span="6"> <el-col :span="6">
...@@ -170,9 +169,9 @@ ...@@ -170,9 +169,9 @@
</el-row> </el-row>
</el-form-item> </el-form-item>
<el-button type="success" plain @click="AddParamsListRow()" class="el-icon-circle-plus">添加行</el-button> <el-button type="success" plain @click="AddParamsListRow()" class="el-icon-circle-plus">添加行</el-button>
</el-collapse-item> </el-collapse-item> -->
<!-- 响应解析列表 --> <!-- 响应解析列表 -->
<el-collapse-item name="4" title="响应提取"> <el-collapse-item name="3" title="响应提取">
<el-form-item> <el-form-item>
<el-row> <el-row>
...@@ -207,15 +206,15 @@ ...@@ -207,15 +206,15 @@
<el-button type="success" plain @click="AddResponseListRow()" class="el-icon-circle-plus">添加行</el-button> <el-button type="success" plain @click="AddResponseListRow()" class="el-icon-circle-plus">添加行</el-button>
</el-collapse-item> </el-collapse-item>
<!-- 断言 --> <!-- 断言 -->
<el-collapse-item name="5" title="结果断言"> <el-collapse-item name="4" title="结果断言">
<el-table :data="assertionList" border style="width:100%;margin-top: 15px;"> <el-table :data="assertionList" border style="width:100%;margin-top: 15px;">
<el-table-column label="表达式" width="350"> <el-table-column label="Json表达式" width="350">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.check"> <el-input v-model="scope.row.check">
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="断言" width="250"> <el-table-column label="比较符" width="250">
<template slot-scope="scope"> <template slot-scope="scope">
<el-select v-model="scope.row.comparator" placeholder="请选择"> <el-select v-model="scope.row.comparator" placeholder="请选择">
<el-option v-for="item in selectAssertionList" :key="item.id" :label="item.name" :value="item.id"></el-option> <el-option v-for="item in selectAssertionList" :key="item.id" :label="item.name" :value="item.id"></el-option>
...@@ -228,21 +227,6 @@ ...@@ -228,21 +227,6 @@
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column label="是否必填" width="150" style="text-align:center">
<template slot-scope="scope">
<el-switch v-model="scope.row.isRequired" active-color="#13ce66" inactive-color="#A9A9A9" active-text="是" inactive-text="否" @change="changeState()"></el-switch>
</template>
</el-table-column> -->
<!-- <el-table-column label="示例" width="300">
<template slot-scope="scope">
<el-input v-model="scope.row.examples"></el-input>
</template>
</el-table-column> -->
<!-- <el-table-column label="备注" width="250">
<template slot-scope="scope">
<el-input v-model="scope.row.remarks"></el-input>
</template>
</el-table-column> -->
<el-table-column label="操作"> <el-table-column label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="danger" icon="el-icon-delete" @click="AssertionDelete(scope.$index)">删除</el-button> <el-button size="mini" type="danger" icon="el-icon-delete" @click="AssertionDelete(scope.$index)">删除</el-button>
...@@ -258,7 +242,7 @@ ...@@ -258,7 +242,7 @@
<el-button type="primary" @click="addCaseFrom">确 定</el-button> <el-button type="primary" @click="addCaseFrom">确 定</el-button>
</div> </div>
</el-form> </el-form>
</el-card> <!-- </el-card> -->
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
...@@ -275,7 +259,6 @@ export default { ...@@ -275,7 +259,6 @@ export default {
data() { data() {
return { return {
col: [ col: [
// { label: '序号', prop: 'sequence' },
{ label: '接口名称', prop: 'interfaceName' }, { label: '接口名称', prop: 'interfaceName' },
{ label: '模块名称', prop: 'moduleName' } { label: '模块名称', prop: 'moduleName' }
], ],
...@@ -345,7 +328,6 @@ export default { ...@@ -345,7 +328,6 @@ export default {
caseName: '', caseName: '',
headers: '', headers: '',
parameters: '', parameters: '',
variables: '',
extract: '', extract: '',
validate: '', validate: '',
sceneId: '' sceneId: ''
...@@ -370,10 +352,9 @@ export default { ...@@ -370,10 +352,9 @@ export default {
interfaceId: '' interfaceId: ''
}, },
editDialogVisible: false, editDialogVisible: false,
activeNames: '1', activeNames: ['1', '2', '3', '4'],
headersList: [], headersList: [],
requestParamsList: [], requestParamsList: [],
paramsList: [],
responseList: [], responseList: [],
assertionList: [], assertionList: [],
caseForm: { caseForm: {
...@@ -382,7 +363,6 @@ export default { ...@@ -382,7 +363,6 @@ export default {
name: '', name: '',
headers: '', headers: '',
parameters: '', parameters: '',
variables: '',
extract: '', extract: '',
validate: '', validate: '',
sequence: '', sequence: '',
...@@ -486,7 +466,6 @@ export default { ...@@ -486,7 +466,6 @@ export default {
name: this.sceneCaseForm.caseDetialList[0].name, name: this.sceneCaseForm.caseDetialList[0].name,
headers: this.sceneCaseForm.caseDetialList[0].headers, headers: this.sceneCaseForm.caseDetialList[0].headers,
parameters: this.sceneCaseForm.caseDetialList[0].parameters, parameters: this.sceneCaseForm.caseDetialList[0].parameters,
variables: this.sceneCaseForm.caseDetialList[0].variables,
extract: this.sceneCaseForm.caseDetialList[0].extract, extract: this.sceneCaseForm.caseDetialList[0].extract,
validate: this.sceneCaseForm.caseDetialList[0].validate, validate: this.sceneCaseForm.caseDetialList[0].validate,
id: this.sceneCaseForm.caseDetialList[0].id, id: this.sceneCaseForm.caseDetialList[0].id,
...@@ -494,7 +473,7 @@ export default { ...@@ -494,7 +473,7 @@ export default {
sceneId: this.sceneCaseInfo.sceneId, sceneId: this.sceneCaseInfo.sceneId,
sequence: this.sceneTestcaseList.length + 1 sequence: this.sceneTestcaseList.length + 1
}) })
console.log('save----', this.sceneTestcaseList) // console.log('save----', this.sceneTestcaseList)
this.DialogVisible = false this.DialogVisible = false
this.sceneCaseForm.moduleFrom = '' this.sceneCaseForm.moduleFrom = ''
this.sceneCaseForm.interfaceFrom = '' this.sceneCaseForm.interfaceFrom = ''
...@@ -510,7 +489,6 @@ export default { ...@@ -510,7 +489,6 @@ export default {
// 编辑场景用例 // 编辑场景用例
editeSceneFrom(row) { editeSceneFrom(row) {
console.log('11', row)
this.editDialogVisible = true this.editDialogVisible = true
this.sceneCaseForm.sequence = row.sequence this.sceneCaseForm.sequence = row.sequence
this.sceneCaseForm.interfaceId = row.interfaceId this.sceneCaseForm.interfaceId = row.interfaceId
...@@ -534,15 +512,6 @@ export default { ...@@ -534,15 +512,6 @@ export default {
paramsValue: newParamters[j] paramsValue: newParamters[j]
}) })
} }
// 参数列表
var newVariables = JSON.parse(row.variables)
this.paramsList = []
for (var k in newVariables) {
this.paramsList.push({
paramsName: k,
paramsValue: newVariables[k]
})
}
// 响应解析列表 // 响应解析列表
var newExtract = JSON.parse(row.extract) var newExtract = JSON.parse(row.extract)
this.responseList = [] this.responseList = []
...@@ -617,17 +586,6 @@ export default { ...@@ -617,17 +586,6 @@ export default {
requestParamsDel(index) { requestParamsDel(index) {
this.requestParamsList.splice(index, 1) this.requestParamsList.splice(index, 1)
}, },
// 天机参数列表行
AddParamsListRow() {
this.paramsList.push({
paramsName: '',
paramsValue: ''
})
},
// 删除参数列表行
paramsDel(index) {
this.paramsList.splice(index, 1)
},
// 添加响应解析行 // 添加响应解析行
AddResponseListRow() { AddResponseListRow() {
this.responseList.push({ this.responseList.push({
...@@ -647,14 +605,6 @@ export default { ...@@ -647,14 +605,6 @@ export default {
expect: '' expect: ''
}) })
}, },
// 断言改变
// changeState(e) {
// if (e === true) {
// this.assertionList.isRequired = e
// } else {
// this.assertionList.isRequired = e
// }
// },
// 删除断言行 // 删除断言行
AssertionDelete(index) { AssertionDelete(index) {
this.assertionList.splice(index, 1) this.assertionList.splice(index, 1)
...@@ -674,12 +624,6 @@ export default { ...@@ -674,12 +624,6 @@ export default {
requestParamsObj[item.paramsName] = item.paramsValue requestParamsObj[item.paramsName] = item.paramsValue
}) })
this.sceneCaseForm.parameters = JSON.stringify(requestParamsObj) this.sceneCaseForm.parameters = JSON.stringify(requestParamsObj)
// 参数列表
var paramsListObj = {}
this.paramsList.forEach((item) => {
paramsListObj[item.paramsName] = item.paramsValue
})
this.sceneCaseForm.variables = JSON.stringify(paramsListObj)
// 响应解析列表 // 响应解析列表
var responseObj = {} var responseObj = {}
this.responseList.forEach((item) => { this.responseList.forEach((item) => {
...@@ -695,13 +639,12 @@ export default { ...@@ -695,13 +639,12 @@ export default {
) { ) {
this.sceneTestcaseList[i].headers = this.sceneCaseForm.headers this.sceneTestcaseList[i].headers = this.sceneCaseForm.headers
this.sceneTestcaseList[i].parameters = this.sceneCaseForm.parameters this.sceneTestcaseList[i].parameters = this.sceneCaseForm.parameters
this.sceneTestcaseList[i].variables = this.sceneCaseForm.variables
this.sceneTestcaseList[i].extract = this.sceneCaseForm.extract this.sceneTestcaseList[i].extract = this.sceneCaseForm.extract
this.sceneTestcaseList[i].validate = this.sceneCaseForm.validate this.sceneTestcaseList[i].validate = this.sceneCaseForm.validate
} }
} }
this.editDialogVisible = false this.editDialogVisible = false
console.log('新集合信息', this.sceneTestcaseList) // console.log('新集合信息', this.sceneTestcaseList)
}, },
cancelCaseFrom() { cancelCaseFrom() {
this.editDialogVisible = false this.editDialogVisible = false
...@@ -713,12 +656,6 @@ export default { ...@@ -713,12 +656,6 @@ export default {
this.sceneTestcaseList.splice(i, 1) this.sceneTestcaseList.splice(i, 1)
} }
} }
},
cellMouseEnter() {
console.log('鼠标移入事件')
},
cellMouseLeave() {
console.log('鼠标移出事件')
} }
} }
} }
......
...@@ -100,9 +100,6 @@ export default { ...@@ -100,9 +100,6 @@ export default {
// 查询方法 // 查询方法
queryData() { queryData() {
this.getInterfaceDetailList() this.getInterfaceDetailList()
// this.queryModuleInfo.projectId = ''
// this.queryModuleInfo.moduleId = ''
// this.queryModuleInfo.interfaceName = ''
}, },
// 添加跳转页面 // 添加跳转页面
addPage() { addPage() {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div> <div>
<el-card> <el-card>
<div class="filter"> <div class="filter">
<el-button type="primary" icon="el-icon-circle-plus" @click="DialogVisible = true">新增</el-button> <el-button type="primary" icon="el-icon-circle-plus" @click="addModelBtn">新增</el-button>
</div> </div>
<el-table :data="modelList" border style="width: 100%;margin-top:20px"> <el-table :data="modelList" border style="width: 100%;margin-top:20px">
<!-- <el-table-column prop="id" label="序号" width="80px"></el-table-column> --> <!-- <el-table-column prop="id" label="序号" width="80px"></el-table-column> -->
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<el-form-item label="模块描述:" prop="description" style="width:400px"> <el-form-item label="模块描述:" prop="description" style="width:400px">
<el-input v-model="addModelForm.description"></el-input> <el-input v-model="addModelForm.description"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="域名:" prop="domain" style="width:400px"> <el-form-item label="域 名:" prop="domain" style="width:400px">
<el-input v-model="addModelForm.domain"></el-input> <el-input v-model="addModelForm.domain"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
<el-form-item label="模块描述:" prop="description" style="width:400px"> <el-form-item label="模块描述:" prop="description" style="width:400px">
<el-input v-model="editModelForm.description"></el-input> <el-input v-model="editModelForm.description"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="域名:" prop="domain" style="width:400px"> <el-form-item label="域 名:" prop="domain" style="width:400px">
<el-input v-model="editModelForm.domain"></el-input> <el-input v-model="editModelForm.domain"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -88,6 +88,10 @@ export default { ...@@ -88,6 +88,10 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10
}, },
queryProjectInfo: {
pageNum: 1,
pageSize: 10
},
totalNum: 0, totalNum: 0,
modelList: [], modelList: [],
projectList: [], projectList: [],
...@@ -144,7 +148,6 @@ export default { ...@@ -144,7 +148,6 @@ export default {
}, },
created() { created() {
this.getModelList() this.getModelList()
this.getProjectList()
}, },
methods: { methods: {
// 获取模块列表 // 获取模块列表
...@@ -156,7 +159,7 @@ export default { ...@@ -156,7 +159,7 @@ export default {
}, },
// 获取项目列表 // 获取项目列表
getProjectList() { getProjectList() {
getProjectList(this.queryModuleInfo).then((resp) => { getProjectList(this.queryProjectInfo).then((resp) => {
this.projectList = resp.data.data.list this.projectList = resp.data.data.list
}) })
}, },
...@@ -170,6 +173,11 @@ export default { ...@@ -170,6 +173,11 @@ export default {
this.queryModuleInfo.pageNum = newPage this.queryModuleInfo.pageNum = newPage
this.getModelList() this.getModelList()
}, },
// 新增按钮
addModelBtn() {
this.DialogVisible = true
this.getProjectList()
},
// 添加模块按钮 // 添加模块按钮
addModelFrom() { addModelFrom() {
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<el-table-column label="操作"> <el-table-column label="操作">
<slot slot-scope="scope"> <slot slot-scope="scope">
<el-button type="warning" icon="el-icon-edit" @click="openEditDialog(scope.row)">编辑</el-button> <el-button type="warning" icon="el-icon-edit" @click="openEditDialog(scope.row)">编辑</el-button>
<!-- <el-button type="danger" icon="el-icon-delete" @click="delProjectFrom(scope.row)">删除</el-button> --> <el-button type="danger" icon="el-icon-delete" @click="delProjectFrom(scope.row)">删除</el-button>
</slot> </slot>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -58,7 +58,12 @@ ...@@ -58,7 +58,12 @@
</template> </template>
<script> <script>
import { getProjectList, addProject, editProject } from '@/api/getAotoInterface' import {
getProjectList,
addProject,
editProject,
delProject
} from '@/api/getAotoInterface'
export default { export default {
data() { data() {
return { return {
...@@ -185,23 +190,23 @@ export default { ...@@ -185,23 +190,23 @@ export default {
.catch(() => {}) .catch(() => {})
}, },
// 删除项目 // 删除项目
// delProjectFrom(row) { delProjectFrom(row) {
// this.delProjectParam.projectId = row.id this.delProjectParam.projectId = row.id
// this.openMessage('您确定要删除吗?', '删除', () => { this.openMessage('您确定要删除吗?', '删除', () => {
// delProject(this.delProjectParam) delProject(this.delProjectParam)
// .then((resp) => { .then((resp) => {
// if (resp.data.data === true) { if (resp.data.data === true) {
// this.$message.success('删除成功!') this.$message.success('删除成功!')
// this.getProjectList() this.getProjectList()
// } else if (resp.data.data === false) { } else if (resp.data.data === false) {
// this.$message.error(resp.data.msg) this.$message.error(resp.data.msg)
// } }
// }) })
// .catch((error) => { .catch((error) => {
// this.$message({ type: 'error', message: error }) this.$message({ type: 'error', message: error })
// }) })
// }) })
// }, },
// 分页展示 // 分页展示
handleSizeChange(newSize) { handleSizeChange(newSize) {
this.queryModuleInfo.pageSize = newSize this.queryModuleInfo.pageSize = newSize
......
<template>
<div>
<el-card>
<el-row>
<el-col :span="10">
<div class="rowStyle">
<el-row>
<el-col :span="4" style="color:#878080">用例名称:</el-col>
<el-col :span="20">
<div>
<el-input v-model="sceneName"></el-input>
</div>
</el-col>
</el-row>
<el-row>
<div class="col_style">
<el-col :span="4" style="color:#878080">用例总数:</el-col>
<el-col :span="20">
<el-input v-model="totalNumber"></el-input>
</el-col>
</div>
</el-row>
<el-row>
<div class="col_style">
<el-col :span="4" style="color:#878080">运行时间(s):</el-col>
<el-col :span="20">
<el-input v-model="totalElapsedTime"></el-input>
</el-col>
</div>
</el-row>
<el-row>
<div class="col_style">
<el-col :span="4" style="color:#878080">通过个数:</el-col>
<el-col :span="20">
<el-input v-model="totalPass"></el-input>
</el-col>
</div>
</el-row>
<el-row>
<div class="col_style">
<el-col :span="4" style="color:#878080">失败个数:</el-col>
<el-col :span="20">
<el-input v-model="totalFail"></el-input>
</el-col>
</div>
</el-row>
</div>
</el-col>
<el-col :span="14">
<div class="divStyle">{{sceneName}}用例执行结果</div>
<div id="chartPie" style="width:900px ;height:250px;margin-top:10px"></div>
</el-col>
</el-row>
</el-card>
<el-card>
<el-table :data="reportDetailList" style="width: 100%" :header-cell-style="{background:'#FFE4C4',color:'#606266'}">
<el-table-column type="expand">
<template slot-scope="props">
<el-row>
<el-col :span="2">
<div class="colStyle">请求头</div>
</el-col>
<el-col :span="22">
<json-viewer :expand-depth=3 :value='props.row.headers'></json-viewer>
</el-col>
</el-row>
<el-row>
<el-col :span="2" class="colStyle">请求参数</el-col>
<el-col :span="22">
<json-viewer :expand-depth=3 :value='props.row.parameters'></json-viewer>
</el-col>
</el-row>
<el-row>
<el-col :span="2" class="colStyle">响应结果</el-col>
<el-col :span="22">
<json-viewer :expand-depth=3 :value='props.row.response'></json-viewer>
</el-col>
</el-row>
<el-row>
<el-col :span="2" class="colStyle">断 言</el-col>
<el-col :span="22">
<el-table v-if="isShowTable" :data="validateList" border style="width: 60%" :header-cell-style="{background:'#E6F3F7',color:'#606266','text-align':'center'}"
:cell-style="{'text-align':'center',background:'#E3EDEB',color:'#606266'}">
<el-table-column prop="check" label="检查值" width="250px"></el-table-column>
<el-table-column prop="comparator" label="比较符" width="250px"></el-table-column>
<el-table-column prop="expect" label="预期结果"></el-table-column>
</el-table>
</el-col>
</el-row>
</template>
</el-table-column>
<el-table-column type='index' label="序号" width="100px"></el-table-column>
<el-table-column prop="interfaceName" label="接口名称" width="250px"></el-table-column>
<el-table-column prop="interfaceUrl" label="接口URL"></el-table-column>
<el-table-column prop="elapsedTime" label="耗时(s)" width="200px"></el-table-column>
<el-table-column prop="status" label="结果" width="200px">
<template slot-scope="scope">
<el-tag :type="scope.row.status === 'pass' ? 'success' : 'danger'" close-transition effect="dark">{{scope.row.status}}</el-tag>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</template>
<script>
import { getReportDetail } from '@/api/getAutoReport'
export default {
name: '',
data() {
return {
queryReportDetail: {
namespace: '',
batch: ''
},
charts: '',
opinion: ['成功', '失败'],
opinionData: [],
reportDetailList: [],
sceneName: '',
validateList: [
{ check: 'name', comparator: 'eq', expect: 'zhansan' },
{ check: 'age', comparator: 'eq', expect: '18' }
],
isShowTable: false,
totalElapsedTime: '',
totalPass: '',
totalFail: '',
totalNumber: ''
}
},
created() {
this.$bus.$off('reportDetail').$on('reportDetail', (row) => {
console.log('参数信息', row)
this.queryReportDetail.namespace = row.namespace
this.queryReportDetail.batch = row.batch
this.sceneName = row.sceneName
this.getReportDetail()
})
},
mounted() {},
methods: {
drawPieChart(id) {
this.charts = this.$echarts.init(document.getElementById(id))
this.charts.setOption({
// title: {
// text: '场景用例执行结果',
// subtext: '',
// left: 300
// },
tooltip: {
trigger: 'item',
formatter: '{a}<br/>{b}:{c} ({d}%)'
},
legend: {
orient: 'vertical', // 图标展示形似(横/竖)
left: 200,
y: 'top',
data: this.opinion
// bottom: 0
},
series: [
{
name: '运行结果',
type: 'pie',
radius: '70%',
// center: ['40%', '60%'],
center: ['45%', '45%'], // 距离左跟上的位置
padding: [500, 10, 0, 0],
itemStyle: {
emphasis: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
},
color: function (params) {
// 自定义颜色
var colorList = ['#50CFC7', '#CD5E5D']
return colorList[params.dataIndex]
}
},
data: this.opinionData
}
]
})
},
// 获取接口详情信息
getReportDetail() {
getReportDetail(this.queryReportDetail).then((resp) => {
this.opinionData = []
this.reportDetailList = resp.data.data.list
this.totalNumber = resp.data.data.total
this.totalElapsedTime = resp.data.data.totalElapsedTime / 1000
this.totalPass = resp.data.data.pass
this.totalFail = resp.data.data.fail
this.reportDetailList.forEach((item) => {
item['headers'] = JSON.parse(item['headers'])
item['parameters'] = JSON.parse(item['parameters'])
item['response'] = JSON.parse(item['response'])
item['elapsedTime'] = item['elapsedTime'] / 1000
if (item['validate'] !== '[]') {
console.log('666', item['validate'].length)
this.validateList = item['validate']
this.isShowTable = true
}
})
this.opinionData.push(
{
value: resp.data.data.pass,
name: '成功'
},
{
value: resp.data.data.fail,
name: '失败'
}
)
this.$nextTick(() => {
this.drawPieChart('chartPie')
})
})
}
}
}
</script>
<style lang="less" scoped>
.divStyle {
font-size: 18px;
color: #333333;
margin-left: 300px;
font-weight: bold;
margin-top: 20px;
}
.colStyle {
font-size: 15px;
font-weight: bold;
// background: red;
margin-top: 30px;
}
.rowStyle {
margin-left: 150px;
margin-top: 20px;
font-size: 15px;
font-weight: bold;
}
.col_style {
margin-top: 28px;
}
</style>
<template>
<div>
<el-card>
<div>
项目:
<el-select v-model="projectId" placeholder="请选择项目" @change="selectChange" clearable>
<el-option v-for="item in projectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
场景:
<el-select v-model="sceneId" placeholder="请选择场景" clearable>
<el-option v-for="item in sceneList" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
<el-input v-model="queryReportInfo.sceneName" clearable placeholder="请输入场景名称" style="width: 300px;"></el-input>
<el-button type="primary" style="margin-left:10px" icon="el-icon-search" @click="queryData">查询</el-button>
</div>
<el-table :data="reportList" border style="width: 100%;margin-top:20px">
<el-table-column type='index' width="50px"></el-table-column>
<el-table-column prop="sceneName" label="场景名称" width="200px"></el-table-column>
<el-table-column prop="projectName" label="项目名称" width="150px"></el-table-column>
<el-table-column prop="namespace" label="运行环境" width="150px"></el-table-column>
<el-table-column prop="createTime" label="创建时间" width="200px"></el-table-column>
<el-table-column label="操作">
<slot slot-scope="scope">
<el-button type="primary" icon="el-icon-chat-line-square" @click="detailReportFrom(scope.row)">详情</el-button>
</slot>
</el-table-column>
</el-table>
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="queryReportInfo.pageNum" :page-size="queryReportInfo.pageSize" layout="total, prev, pager, next"
:total="totalNum"></el-pagination>
</el-card>
</div>
</template>
<script>
import { getProjectList } from '@/api/getAotoInterface'
import { getSceneList } from '@/api/getAutoScene'
import { getReportList } from '@/api/getAutoReport'
export default {
data() {
return {
queryReportInfo: {
pageNum: 1,
pageSize: 10,
projectId: '',
sceneId: '',
sceneName: '',
namespace: ''
},
projectId: '',
sceneId: '',
namespace: '',
queryProjectInfo: {
pageNum: 1,
pageSize: 20
},
querySceneInfo: {
pageNum: 1,
pageSize: 20,
projectId: ''
},
reportList: [],
projectList: [],
sceneList: [],
totalNum: 0
}
},
created() {
this.getProjectList()
this.getReportList()
this.$bus.$off('reportmsg').$on('reportmsg', (row) => {
// console.log('参数信息', row)
// 下拉框赋值
this.projectId = row.projectName
this.sceneId = row.name
// 传递参数信息
this.queryReportInfo.sceneId = row.id
this.queryReportInfo.projectId = row.projectId
getReportList(this.queryReportInfo).then((resp) => {
this.reportList = resp.data.data.list
this.totalNum = resp.data.data.total
})
})
},
methods: {
// 项目列表
getProjectList() {
getProjectList(this.queryProjectInfo).then((resp) => {
this.projectList = resp.data.data.list
})
},
// 下拉项目改变事件
selectChange() {
this.getSceneList()
},
// 获取场景列表
getSceneList() {
this.querySceneInfo.projectId = this.projectId
getSceneList(this.querySceneInfo).then((resp) => {
this.sceneList = resp.data.data.list
})
},
// 获取场景报告列表
getReportList() {
this.queryReportInfo.namespace = window.sessionStorage.getItem('env')
getReportList(this.queryReportInfo).then((resp) => {
this.reportList = resp.data.data.list
this.totalNum = resp.data.data.total
})
},
// 点击查询调取方法
queryReportList() {
this.queryReportInfo.projectId = this.projectId
this.queryReportInfo.sceneId = this.sceneId
// console.log('参数信息6666', this.queryReportInfo)
this.queryReportInfo.namespace = window.sessionStorage.getItem('env')
getReportList(this.queryReportInfo).then((resp) => {
this.reportList = resp.data.data.list
this.totalNum = resp.data.data.total
})
},
// 查询方法
queryData() {
this.queryReportList()
},
// 报表详情信息
detailReportFrom(row) {
this.$router.push({ path: 'ReportDetail' })
// bus使用
this.$nextTick(function () {
// DOM 现在更新了
this.$bus.$emit('reportDetail', row)
})
},
handleSizeChange(newSize) {
this.queryReportInfo.pageSize = newSize
this.getReportList()
},
handleCurrentChange(newPage) {
this.queryReportInfo.pageNum = newPage
this.getReportList()
}
}
}
</script>
<style lang="less" scoped>
.el-select {
margin: 0 10px 0 5px;
}
</style>
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
<el-button type="success" icon="el-icon-link" @click="executeSceneFrom(scope.row)">执行</el-button> <el-button type="success" icon="el-icon-link" @click="executeSceneFrom(scope.row)">执行</el-button>
<el-button type="warning" icon="el-icon-edit" @click="editeSceneFrom(scope.row)">编辑场景</el-button> <el-button type="warning" icon="el-icon-edit" @click="editeSceneFrom(scope.row)">编辑场景</el-button>
<el-button type="warning" icon="el-icon-edit" @click="editeSceneCaseFrom(scope.row)">编辑场景用例</el-button> <el-button type="warning" icon="el-icon-edit" @click="editeSceneCaseFrom(scope.row)">编辑场景用例</el-button>
<el-button type="primary" icon="el-icon-circle-check" @click="checkReport(scope.row)">查看报告</el-button>
<!-- <el-button type="danger" icon="el-icon-delete" @click="deleSceneFrom(scope.row)">删除</el-button> --> <!-- <el-button type="danger" icon="el-icon-delete" @click="deleSceneFrom(scope.row)">删除</el-button> -->
</slot> </slot>
</el-table-column> </el-table-column>
...@@ -264,6 +265,15 @@ export default { ...@@ -264,6 +265,15 @@ export default {
// 关闭清空数据 // 关闭清空数据
closeAddDialog() { closeAddDialog() {
this.$refs.addSceneFormRef.resetFields() this.$refs.addSceneFormRef.resetFields()
},
// 查看报告
checkReport(row) {
this.$router.push({ path: 'ReportList' })
// bus使用
this.$nextTick(function () {
// DOM 现在更新了
this.$bus.$emit('reportmsg', row)
})
} }
} }
} }
......
...@@ -140,6 +140,12 @@ ...@@ -140,6 +140,12 @@
"title": "场景管理", "title": "场景管理",
"icon": "el-icon-thumb", "icon": "el-icon-thumb",
"path": "/auto/SceneList" "path": "/auto/SceneList"
},
{
"id": 6,
"title": "报告管理",
"icon": "el-icon-document",
"path": "/auto/ReportList"
} }
] ]
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment