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

提交场景用例模块

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