Commit 8cf764fe authored by 王晓铜's avatar 王晓铜

提交场景用例模块

parent 3f04c32f
......@@ -10,4 +10,5 @@ module.exports = merge(prodEnv, {
// HOLMES: '"//localhost:8084"',
QA_PLATFORM: '"//qa-platform-fe.liangkebang.net/"',
HOLMES: '"//holmes-fe.liangkebang.net/"',
// HOLMES: '"//192.168.29.143:8084/"'
})
......@@ -12,8 +12,8 @@ module.exports = {
assetsPublicPath: '/',
proxyTable: {},
// Various Dev Server settings
host: 'localhost', // can be overwritten by process.env.HOST
// Various Dev Server settings localhost
host: '0.0.0.0', // can be overwritten by process.env.HOST
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: false,
errorOverlay: true,
......
......@@ -14006,6 +14006,11 @@
"is-plain-obj": "^1.0.0"
}
},
"sortablejs": {
"version": "1.13.0",
"resolved": "https://registry.npmjs.org/sortablejs/-/sortablejs-1.13.0.tgz",
"integrity": "sha512-RBJirPY0spWCrU5yCmWM1eFs/XgX2J5c6b275/YyxFRgnzPhKl/TDeU2hNR8Dt7ITq66NRPM4UlOt+e5O4CFHg=="
},
"source-list-map": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz",
......
......@@ -30,3 +30,19 @@ export function getSceneCaseList(queryInfo) {
params: queryInfo
})
}
// 添加场景用例接口
export function addSceneCase(data) {
return request({
url: '/auto/sceneTestcase/saveOrUpdate',
method: 'post',
data
})
}
// 执行场景用例接口
export function executeScene(queryInfo) {
return request({
url: '/auto/execute/scene',
method: 'get',
params: queryInfo
})
}
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import VueBus from 'vue-bus'
import App from './App'
import '../src/assets/css/global.css'
import router from './router'
......@@ -10,6 +9,8 @@ import 'element-ui/lib/theme-chalk/index.css'
import axios from 'axios'
import store from './store/store'
import JsonViewer from 'vue-json-viewer'
import bus from '../src/utils/bus'
// import Sortable from 'sortablejs'
import {
Container,
Header,
......@@ -55,6 +56,7 @@ Vue.prototype.$echarts = echarts
Vue.prototype.$message = Message
Vue.prototype.$loading = Loading
Vue.prototype.$messageBox = MessageBox
Vue.prototype.$bus = bus
// axios.defaults.baseURL = 'https://qa-platform-pre.liangkebang.net'
// axios.defaults.baseURL = 'http://localhost:8082'
......@@ -89,8 +91,8 @@ Vue.use(RadioGroup)
Vue.use(Radio)
Vue.use(Row)
Vue.use(Col)
Vue.use(VueBus)
Vue.use(JsonViewer)
// Vue.use(Sortable)
/* eslint-disable no-new */
new Vue({
el: '#app',
......
......@@ -24,6 +24,7 @@ import CaseList from '../views/auto/CaseList'
import AddCase from '../views/auto/AddCase'
import SceneList from '../views/auto/SceneList'
import EditScene from '../views/auto/EditScene'
Vue.use(Router)
const router = new Router({
mode: 'history',
......
......@@ -202,7 +202,7 @@
<script>
import { getModulList, interfaceDetailList } from '@/api/getAotoInterface'
import { getInterfaceDetail, addCase, editCase } from '@/api/getAutoCase'
import bus from '@/utils/bus'
// import bus from '@/utils/bus'
export default {
data() {
return {
......@@ -272,7 +272,7 @@ export default {
},
created() {
this.getModelList()
bus.$on('casemsg', (row) => {
this.$bus.$on('casemsg', (row) => {
// console.log('接收到的信息', row)
if (row !== null) {
if (row === '新增') {
......@@ -455,8 +455,6 @@ export default {
this.caseForm.extract = JSON.stringify(responseObj)
// 断言
this.caseForm.validate = JSON.stringify(this.assertionList)
// console.log('保存信息', this.caseForm)
if (this.caseForm.id) {
// 编辑接口
editCase(this.caseForm).then((resp) => {
......@@ -484,12 +482,13 @@ export default {
})
}
},
// 刷新列表
sendResh() {
// bus使用
this.$nextTick(function () {
// DOM 现在更新了
bus.$emit('refresh')
this.$bus.$emit('refresh')
})
}
}
......
......@@ -169,7 +169,7 @@ import {
addInterface,
editInterface
} from '@/api/getAotoInterface'
import bus from '@/utils/bus'
// import bus from '@/utils/bus'
export default {
data() {
return {
......@@ -257,7 +257,7 @@ export default {
}
},
created() {
bus.$on('msg', (row) => {
this.$bus.$on('msg', (row) => {
if (row !== null) {
if (row === '新增') {
this.interfaceForm.id = ''
......@@ -356,7 +356,7 @@ export default {
// bus使用
this.$nextTick(function () {
// DOM 现在更新了
bus.$emit('refresh')
this.$bus.$emit('refresh')
})
},
// 保存接口信息
......
......@@ -44,7 +44,7 @@
<script>
import { getModulList } from '@/api/getAotoInterface'
import { singleCaseList, delCase, executeCase } from '@/api/getAutoCase'
import bus from '@/utils/bus'
// import bus from '@/utils/bus'
export default {
data() {
return {
......@@ -77,7 +77,7 @@ export default {
this.isShow = false
this.getModulList()
this.getCaseList()
bus.$on('refresh', () => {
this.$bus.$on('refresh', () => {
this.isShow = false
this.getCaseList()
})
......@@ -110,7 +110,7 @@ export default {
this.$nextTick(function () {
// DOM 现在更新了
var row = '新增'
bus.$emit('casemsg', row)
this.$bus.$emit('casemsg', row)
})
},
// 执行用例
......@@ -130,7 +130,7 @@ export default {
// bus使用
this.$nextTick(function () {
// DOM 现在更新了
bus.$emit('casemsg', row)
this.$bus.$emit('casemsg', row)
})
},
// 对话框方法
......
This diff is collapsed.
......@@ -25,7 +25,7 @@
</el-pagination>
</el-card>
<!-- 新增页面 /编辑页面-->
<el-dialog title="新增项目" :visible.sync="DialogVisible" width="30%" @close="closeEditDialog">
<el-dialog title="新增项目" :visible.sync="DialogVisible" width="30%">
<el-form ref="projectForm" :rules="rules" :model="projectForm" label-width="90px">
<el-form-item label="项目名称:" prop="name" style="width:400px">
<el-input v-model="projectForm.name"></el-input>
......
......@@ -55,9 +55,13 @@
</div>
</template>
<script>
import { getSceneList, addSecene, delSecne } from '@/api/getAutoScene'
import {
getSceneList,
addSecene,
delSecne,
executeScene
} from '@/api/getAutoScene'
import { getProjectList } from '@/api/getAotoInterface'
import bus from '@/utils/bus'
export default {
data() {
return {
......@@ -97,13 +101,20 @@ export default {
delSceneForm: {
sceneId: ''
},
isShow: false,
requestData: ''
isShow: true,
requestData: '',
executeScene: {
sceneId: '',
namespace: ''
}
}
},
created() {
this.getSecneList()
this.getProjectList()
this.$bus.$on('refreshScene', () => {
this.getSecneList()
})
},
methods: {
// 获取场景列表
......@@ -124,14 +135,26 @@ export default {
this.getSecneList()
},
// 执行场景
executeSceneFrom() {},
executeSceneFrom(row) {
// 获取用例id
this.executeScene.sceneId = row.id
this.executeScene.namespace = window.sessionStorage.getItem('env')
// this.isShow = true
executeScene(this.executeScene).then((resp) => {
console.log('接口返回结果', resp)
this.requestData = resp.data.data
})
},
// 编辑场景
editeSceneFrom(row) {
window.sessionStorage.setItem('curScene', JSON.stringify(row))
this.$router.push({ path: 'EditScene' })
// this.$router.push({ path: 'tese' })
// bus使用
this.$nextTick(function () {
// DOM 现在更新了
bus.$emit('scenemsg', row)
this.$bus.$emit('scenemsg', row)
})
},
// 对话框方法
......
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