Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
InterfaceAutoTest
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TestAuto
InterfaceAutoTest
Commits
c9d15a74
Commit
c9d15a74
authored
Oct 08, 2021
by
liangyan10
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://10.197.236.199:8001/TestAuto/InterfaceAutoTest
parents
2e756abc
836e63b5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
18 deletions
+43
-18
common/tools.py
+1
-3
common/utils/dingTalk.py
+24
-3
config.py
+6
-1
requirements.txt
+1
-0
test_case/safe_transportation/jgd/test_archives.py
+11
-11
No files found.
common/tools.py
View file @
c9d15a74
...
...
@@ -97,13 +97,12 @@ def send_dingding(product_name):
if
product_name
==
BmyConfig
.
name
:
dingTalk_markdown_bmy
(
BaseConfig
.
bmy_group
)
# 给交委项目相关群发送钉钉
if
product_name
==
SSOConfig
.
name
:
pass
dingTalk_markdown_sso
(
BaseConfig
.
sso_group
)
# 交委
if
product_name
==
SafeTransportationConfig
.
name
:
dingTalk_markdown_safe_transportation
(
BaseConfig
.
bmy_group
)
def
get_run
(
envrioment
):
"""根据传入环境名字,来填入环境配置"""
pass
\ No newline at end of file
common/utils/dingTalk.py
View file @
c9d15a74
...
...
@@ -86,7 +86,7 @@ def dingTalk_markdown_bmy(group):
"markdown"
:
{
"title"
:
"接口执行报告"
,
"text"
:
f
"#### 接口自动化测试报告
\n
> 本消息由Jenkins构建后自动发送
\n
>
\

\n
> ###### 点击查看 >> [安全运输
](http://10.197.236.10:8080/job/bmy/allure/)
\n
"
\n
> ###### 点击查看 >> [企业云测试报告
](http://10.197.236.10:8080/job/bmy/allure/)
\n
"
},
'at'
:
{
'isAtAll'
:
False
}}
post_data
=
json
.
dumps
(
data
)
...
...
@@ -103,14 +103,34 @@ def dingTalk_markdown_safe_transportation(group):
"markdown"
:
{
"title"
:
"接口执行报告"
,
"text"
:
f
"#### 接口自动化测试报告
\n
> 本消息由Jenkins构建后自动发送
\n
>
\

\n
> ###### 点击查看 >> [交委安全运输监管平台](http://10.197.236.10:8080/job/safe_transportation/allure/)
\n
"
\n
> ###### 点击查看 >> [交委安全运输监管平台](http://10.197.236.10:8080/job/safe_transportation/allure/)
\n
"
},
'at'
:
{
'isAtAll'
:
False
}}
post_data
=
json
.
dumps
(
data
)
requests
.
post
(
webhook
,
headers
=
BaseConfig
.
headers
,
data
=
post_data
)
def
dingTalk_markdown_sso
(
group
):
for
i
in
group
:
"""发送消息到钉钉群(sso)"""
timestamp
=
str
(
round
(
time
.
time
()
*
1000
))
sign
=
get_sign
(
i
[
"secret"
])
webhook
=
i
[
"webhook"
]
+
f
"×tamp={timestamp}&sign={sign}"
now_time
=
datetime
.
datetime
.
now
()
.
strftime
(
'
%
Y-
%
m-
%
d
%
H:
%
M'
)
data
=
{
'msgtype'
:
'markdown'
,
"markdown"
:
{
"title"
:
"接口执行报告"
,
"text"
:
f
"#### 接口自动化测试报告
\n
> 本消息由Jenkins构建后自动发送
\n
>
\
\n
> ###### 点击查看 >> [统一登录平台](http://10.197.236.10:8080/job/sso/allure/)
\n
"
},
'at'
:
{
'isAtAll'
:
False
}}
post_data
=
json
.
dumps
(
data
)
requests
.
post
(
webhook
,
headers
=
BaseConfig
.
headers
,
data
=
post_data
)
# """ 通用 (未调试)"""
# (https://img.banmago.com/group2/M00/06/BB/rBrpX2El37CASho8ABlIIu9o6i4942.png)
# def dingTalk_markdown(group,picture,title,allureurl):
# for i in group:
# timestamp = str(round(time.time() * 1000))
...
...
@@ -149,6 +169,6 @@ if __name__ == '__main__':
{
"secret"
:
"SEC465015385218e70a94f107a16f72dd33d8fc118c3b2a631e0433685302f2fbb3"
,
"webhook"
:
"https://oapi.dingtalk.com/robot/send?access_token=229908a83825ed56abbf728d3382e446a4e8a90e9ad302c37a036bcbccbbf9ee"
,
"group"
:
"自动化小组"
}]
dingTalk_markdown_
safe_transportation
(
bmy
_group
)
dingTalk_markdown_
bmy
(
test
_group
)
# dingTalk_markdown(test_group,"https://aqjg.gyszhjt.com:60028/img/group1/M00/00/04/Cgs5XWD2NrOACeeHAAhEU1jS9Xc475.png","交委项目","http://10.197.236.10:8080/job/bmc/allure/")
\ No newline at end of file
config.py
View file @
c9d15a74
...
...
@@ -6,7 +6,7 @@ class BaseConfig():
# 请求头
headers
=
{
'Content-Type'
:
'application/json'
}
# 当前运行的产品名 #auto
current_name
=
"s
so
"
current_name
=
"s
Transport
"
test_case_dir
=
"test_case/"
secs
=
0.1
# 测试用例间隔运行时间
...
...
@@ -32,6 +32,11 @@ class BaseConfig():
"group"
:
"测试序列"
}
]
# 统一登录平台钉钉发送群
sso_group
=
[{
"secret"
:
"SEC7714672a0be0239dbff12083d6beca3961490f1f5384c616ea259015d7e71cd1"
,
"webhook"
:
"https://oapi.dingtalk.com/robot/send?access_token=10baf66992f12849793666ee882569bf50d313e9c070ab1afbff25cb9ffcd567"
,
"group"
:
"测试序列"
}]
# 日志相关
log_path
=
r''
# 日志路径
...
...
requirements.txt
View file @
c9d15a74
...
...
@@ -35,4 +35,5 @@ urllib3==1.25.11; python_version >= '2.7' and python_version not in '3.0, 3.1, 3
xlrd
==1.2.0
zipp
==3.4.1; python_version >= '3.6'
dict
==2020.12.3
config
==0.5.1
test_case/safe_transportation/jgd/test_archives.py
View file @
c9d15a74
...
...
@@ -91,7 +91,7 @@ class TestEnterpriseArchives():
assert
res
[
'code'
]
==
expectData
[
'code'
]
@allure.story
(
"关键指标风险明细"
)
@allure.title
(
"
inData[testPoint]
"
)
@allure.title
(
"
{inData[testPoint]}
"
)
@allure.testcase
(
"http://yapi.hikcreate.com/project/336/interface/api/85272"
)
@allure.description
(
"/enterprise-archives/keyIndicatorsRiskDetail"
)
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
"全息档案"
,
"enterpriseArchiveIndicatorsRisk"
))
...
...
@@ -106,7 +106,7 @@ class TestEnterpriseArchives():
assert
res
[
'code'
]
==
expectData
[
'code'
]
@allure.story
(
"关键指标信息"
)
@allure.title
(
"
inData[testPoint]
"
)
@allure.title
(
"
{inData[testPoint]}
"
)
@allure.testcase
(
"http://yapi.hikcreate.com/project/336/interface/api/85321"
)
@allure.description
(
"/enterprise-archives/safeProductionStat"
)
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
"全息档案"
,
"enterpriseArchiveIndicators"
))
...
...
@@ -121,7 +121,7 @@ class TestEnterpriseArchives():
assert
res
[
'code'
]
==
expectData
[
'code'
]
@allure.story
(
"关键指标变化趋势"
)
@allure.title
(
"
inData[testPoint]
"
)
@allure.title
(
"
{inData[testPoint]}
"
)
@allure.testcase
(
"http://yapi.hikcreate.com/project/336/interface/api/85335"
)
@allure.description
(
"/enterprise-archives/keyIndicatorsTimeTrend"
)
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
"全息档案"
,
"enterpriseArchiveIndicatorsTrend"
))
...
...
@@ -136,7 +136,7 @@ class TestEnterpriseArchives():
assert
res
[
'code'
]
==
expectData
[
'code'
]
@allure.story
(
"关键指标统计报表"
)
@allure.title
(
"
inData[testPoint]
"
)
@allure.title
(
"
{inData[testPoint]}
"
)
@allure.testcase
(
"http://yapi.hikcreate.com/project/336/interface/api/85328"
)
@allure.description
(
"/enterprise-archives/keyIndicatorsReport"
)
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
"全息档案"
,
"enterpriseArchiveIndicatorsReport"
))
...
...
@@ -152,7 +152,7 @@ class TestEnterpriseArchives():
@allure.story
(
"关键指标风险详情"
)
@allure.title
(
"
inData[testPoint]
"
)
@allure.title
(
"
{inData[testPoint]}
"
)
@allure.testcase
(
"http://yapi.hikcreate.com/project/336/interface/api/85342"
)
@allure.description
(
"/enterprise-archives/riskDetail"
)
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
"全息档案"
,
"enterpriseArchiveRisk"
))
...
...
@@ -168,7 +168,7 @@ class TestEnterpriseArchives():
@allure.story
(
"获取风险类型"
)
@allure.title
(
"
inData[testPoint]
"
)
@allure.title
(
"
{inData[testPoint]}
"
)
@allure.testcase
(
"http://yapi.hikcreate.com/project/336/interface/api/67617"
)
@allure.description
(
"/dic/getRisk?fromStatPage=true"
)
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
"全息档案"
,
"enterpriseArchiveGetRisk"
))
...
...
@@ -183,7 +183,7 @@ class TestEnterpriseArchives():
assert
res
[
'code'
]
==
expectData
[
'code'
]
@allure.story
(
"驾驶人档案列表"
)
@allure.title
(
"
inData[testPoint]
"
)
@allure.title
(
"
{inData[testPoint]}
"
)
@allure.testcase
(
"http://yapi.hikcreate.com/project/336/interface/api/69873"
)
@allure.description
(
"/driver-archives/query"
)
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
"全息档案"
,
"driverArchivesQuery"
))
...
...
@@ -198,7 +198,7 @@ class TestEnterpriseArchives():
assert
res
[
'code'
]
==
expectData
[
'code'
]
@allure.story
(
"驾驶人档案详情"
)
@allure.title
(
"
inData[testPoint]
"
)
@allure.title
(
"
{inData[testPoint]}
"
)
@allure.testcase
(
"http://yapi.hikcreate.com/project/336/interface/api/85384"
)
@allure.description
(
"/drivers/page"
)
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
"全息档案"
,
"driverArchivesDrivers"
))
...
...
@@ -213,7 +213,7 @@ class TestEnterpriseArchives():
assert
res
[
'code'
]
==
expectData
[
'code'
]
@allure.story
(
"驾驶人特征"
)
@allure.title
(
"
inData[testPoint]
"
)
@allure.title
(
"
{inData[testPoint]}
"
)
@allure.testcase
(
"http://yapi.hikcreate.com/project/336/interface/api/85307"
)
@allure.description
(
"/driver-archives/driverFeatureStat"
)
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
"全息档案"
,
"driverArchivesFeature"
))
...
...
@@ -228,7 +228,7 @@ class TestEnterpriseArchives():
assert
res
[
'code'
]
==
expectData
[
'code'
]
@allure.story
(
"驾驶人关联车辆"
)
@allure.title
(
"
inData[testPoint]
"
)
@allure.title
(
"
{inData[testPoint]}
"
)
@allure.testcase
(
"http://yapi.hikcreate.com/project/336/interface/api/85314"
)
@allure.description
(
"/driver-archives/associatedVehicle"
)
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
"全息档案"
,
"driverArchivesAssociatedVehicle"
))
...
...
@@ -243,7 +243,7 @@ class TestEnterpriseArchives():
assert
res
[
'code'
]
==
expectData
[
'code'
]
@allure.story
(
"驾驶人关联企业"
)
@allure.title
(
"
inData[testPoint]
"
)
@allure.title
(
"
{inData[testPoint]}
"
)
@allure.testcase
(
"http://yapi.hikcreate.com/project/336/interface/api/85293"
)
@allure.description
(
"/vehicle-archives/driverAssociatedEnterprise"
)
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
"全息档案"
,
"driverArchivesAssociatedEnterprise"
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment