Commit 095eff5f authored by Wallen姚文辉's avatar Wallen姚文辉

添加接口自动化接入

parent dbe0180f
.layout{border:1px solid #d7dde4;background:#f5f7f9;position:relative;border-radius:4px;overflow:hidden}.layout-logo{width:100px;height:30px;background:#5b6270;border-radius:3px;float:left;position:relative;top:15px;left:20px}.layout-nav{margin:0 auto;display:flex}.card{height:300px;background:rgba(103,176,185,.7);transform:translateY(90%);-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px);border-radius:30px 5px 15px 5px;text-align:center}.login{max-width:400px;margin:0 auto!important;transform:translateY(40%)}.vertical-center-modal{display:flex;align-items:center;justify-content:center}.vertical-center-modal .ivu-modal{top:0}.chart{height:100vh}
\ No newline at end of file
.layout{border:1px solid #d7dde4;background:#f5f7f9;position:relative;border-radius:4px;overflow:hidden}.layout-logo{width:100px;height:30px;background:#5b6270;border-radius:3px;float:left;position:relative;top:15px;left:20px}.layout-nav{margin:0 auto;display:flex}.card{height:300px;background:rgba(103,176,185,.7);transform:translateY(90%);-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px);border-radius:30px 5px 15px 5px;text-align:center}.login{max-width:400px;margin:0 auto!important;transform:translateY(40%)}.vertical-center-modal{display:flex;align-items:center;justify-content:center}.vertical-center-modal .ivu-modal{top:0}.chart{height:100vh}@keyframes changDeg{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.demo-spin-icon-load{color:#2b85e4;animation:changDeg 2s linear .2s infinite}
\ No newline at end of file
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>yinhe_test</title><script defer="defer" src="/js/chunk-vendors.822ae491.js"></script><script defer="defer" src="/js/app.63d37ec0.js"></script><link href="/css/chunk-vendors.187ae3e6.css" rel="stylesheet"><link href="/css/app.3954dbdf.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but yinhe_test doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
\ No newline at end of file
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>yinhe_test</title><script defer="defer" src="/js/chunk-vendors.822ae491.js"></script><script defer="defer" src="/js/app.5696f21a.js"></script><link href="/css/chunk-vendors.187ae3e6.css" rel="stylesheet"><link href="/css/app.7091cd70.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but yinhe_test doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -12,9 +12,36 @@
<Option v-for="item in iterations" :value="item.key" :key="item.key">{{ item.name }}</Option>
</Select>
<Button type="primary" @click="breforesend" style="width:100px;margin-left: 10px;">发送邮件</Button>
<Button type="primary" @click="breforerunjenkins" style="width:130px;margin-left: 10px;">回归脚本运行</Button>
</div>
</template>
</PageHeader>
<Collapse v-model="defaultvalue" accordion simple>
<Panel name="1">
jenkins最新运行结果
<template #content>
<Table :columns="jenkins_columns" :data="jenkis_data">
<template #action="{ row, index }">
<div fix v-if="row.running">
<Icon type="md-ionic" size=18 class="demo-spin-icon-load"></Icon>
<div>运行中</div>
</div>
<div v-if="!row.running">
<Icon v-if="row.result == 'SUCCESS'" type="ios-checkmark-circle-outline" size=18
style="color: #19be6b;"></Icon>
<div v-if="row.result == 'SUCCESS'">已完成</div>
<Icon v-if="row.result == 'ABORTED'" type="md-close-circle" size=18 style="color: #c5c8ce;">
</Icon>
<div v-if="row.result == 'ABORTED'">已取消</div>
<Icon v-if="row.result == 'FAILURE'" type="ios-close-circle-outline" size=18
style="color: #ed4014;"></Icon>
<div v-if="row.result == 'FAILURE'">失败</div>
</div>
</template>
</Table>
</template>
</Panel>
</Collapse>
<Card v-if="report">
<template #extra>
<Icon v-if="!edit" type="md-create" @click="edit = !edit" size="20" color="#2b85e4" />
......@@ -133,14 +160,6 @@
</Table>
</div>
</div>
<!-- <Collapse simple v-model="cShow">
<Panel v-for="item in story" :name="item.key">
<template #content>
</template>
</Panel>
</Collapse> -->
<Button shape="circle" style="margin-top: 10px;margin-bottom: 10px;" type="primary">bug记录</Button>
<Table :columns="bugcolumns" :data="bug">
<template #summary="{ row, index }">
......@@ -178,6 +197,40 @@
size="15" />
</template>
</Table>
<Button shape="circle" style="margin-top: 10px;margin-bottom: 10px;" type="primary">自动化运行结果</Button>
<Table :columns="script_result_columns" :data="jenkis_data">
<template #name="{ row, index }">
<a target="_blank" :href="row.reportPath">
<u>{{ row.job }}</u>
</a>
</template>
<template #time="{ row, index }">
<p>
{{ row.time }}
</p>
</template>
<template #total="{ row, index }">
<p>
{{ row.total }}
</p>
</template>
<template #success="{ row, index }">
<p>
{{ row.success }}
</p>
</template>
<template #fail="{ row, index }">
<p>
{{ row.fail }}
</p>
</template>
<template #abf="{ row, index }">
<p>
{{ row.success && row.total ? (parseInt(row.success) / parseInt(row.total) * 100).toFixed(2) + '%' : ''
}}
</p>
</template>
</Table>
</div>
<div id="biao" style="margin-top: 10px;">
<Row>
......@@ -210,6 +263,18 @@
</template>
</Modal>
</Space>
<Space wrap>
<Modal title="运行脚本" v-model="runscriptShow" class-name="vertical-center-modal"
@on-cancel="runscriptShow = false">
<CheckboxGroup v-model="run_script">
<Checkbox v-for="item in all_script" :label="item.name" border style="margin-top: 10px;"></Checkbox>
</CheckboxGroup>
<template #footer>
<Button @click="runscriptShow=false">取消</Button>
<Button type="primary" @click="runscript">确认</Button>
</template>
</Modal>
</Space>
</template>
<script>
......@@ -218,11 +283,63 @@ export default {
props: ['isCollapsed'],
data() {
return {
defaultvalue: "",
modlShow: false,
runscriptShow: false,
sendto: [],
sendcc: [],
defaultcc: [],
emailList: [],
jenkis_data: [],
run_script: [],
all_script: [],
jenkins_columns: [
{
title: '脚本名',
key: 'job'
},
{
title: '最近运行时间',
key: 'time'
}, {
title: '状态',
slot: 'action',
align: 'center'
}
],
script_result_columns: [
{
title: '脚本名',
slot: 'name',
},
{
title: '运行时间',
slot: 'time',
},
{
title: '用例总数',
slot: 'total',
}, {
title: '成功数',
slot: 'success',
align: 'center'
},
{
title: '失败数',
slot: 'fail',
align: 'center'
},
{
title: '通过率',
slot: 'abf',
align: 'center'
}
],
bug_p_column: {
title: {
text: 'bug优先级占比',
......@@ -478,6 +595,26 @@ export default {
const index = this.mycase.findIndex(ele => { return ele.key == key })
return index == -1 ? null : this.mycase[index]
},
getJenkinsInfo() {
this.$request("get", '/tool/testport/runresult', null, this, (data) => {
this.jenkis_data = data.data;
setTimeout(() => {
this.getJenkinsInfo();
}, 5000);
})
},
breforerunjenkins() {
this.$request("get", "/tool/testport/allscript", null, this, (data) => {
this.all_script = data.data;
this.run_script = this.all_script.map((each) => { return each.name })
this.runscriptShow = true;
})
},
runscript() {
this.$request("post", "/tool/testport/runjobs", this.run_script, this, () => {
this.runscriptShow = false;
})
},
rmcase(key) {
const index = this.mycase.findIndex(ele => ele.key == key)
index != -1 && this.mycase.splice(index, 1)
......@@ -704,7 +841,8 @@ export default {
}
},
created() {
this.getprojects()
this.getprojects();
this.getJenkinsInfo();
this.myname = JSON.parse(localStorage.getItem("userinfo")).name
},
mounted() {
......@@ -712,8 +850,23 @@ export default {
};
</script>
<style>
<style type="text/css">
.chart {
height: 100vh;
}
@keyframes changDeg {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.demo-spin-icon-load {
color: #2b85e4;
animation: changDeg 2s linear 0.2s infinite;
}
</style>
\ No newline at end of file
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