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
9e378e80
Commit
9e378e80
authored
May 08, 2021
by
taoke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
企业云增加风控台用例
parent
c16ed66c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
0 deletions
+50
-0
test_case/bmy/test_riskMonitar.py
+50
-0
test_case_data/bmy/bmy_case.xlsx
+0
-0
No files found.
test_case/bmy/test_riskMonitar.py
0 → 100644
View file @
9e378e80
#作者: taoke
#时间: 2021/5/8 10:39
#编码: -- coding: utf-8 --
#版本: !python3.7
import
pytest
,
allure
,
xlrd
,
requests
,
os
from
common.utils.getExcelData
import
get_excelData
from
service.login
import
BMY
from
common.tools
import
request_main
from
config
import
BmyConfig
from
service.login
import
BMY
@allure.epic
(
"营运车企业端"
)
@allure.feature
(
"风控台"
)
class
TestLogin
():
workBook
=
xlrd
.
open_workbook
(
f
'{BmyConfig.root_path}/test_case_data/bmy/bmy_case.xlsx'
)
def
setup_class
(
self
):
# 每一个类下面所有的方法调用只运行一次
self
.
token
=
BMY
()
.
bmy_login
(
BmyConfig
.
test_name_password
)
@allure.story
(
"风险监控列表接口"
)
@allure.title
(
"风险监控列表用例"
)
@allure.testcase
(
"http://yapi.hikcreate.com/"
)
@allure.description
(
"url:/auth/login 。。。。"
)
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
'风控台'
,
'riskMonitorList'
))
def
test_login
(
self
,
inData
):
url
=
f
"{BmyConfig().test_host}{inData['url']}"
method
=
inData
[
'method'
]
req_data
=
inData
[
'reqData'
]
expectData
=
inData
[
'expectData'
]
headers
=
inData
[
'headers'
]
"""处理"""
headers
[
'Authorization'
]
=
self
.
token
"""请求"""
res
=
request_main
(
url
,
headers
,
method
,
req_data
)
"""断言"""
print
(
res
)
assert
res
[
'code'
]
==
expectData
[
'code'
]
if
__name__
==
'__main__'
:
for
one
in
os
.
listdir
(
'../../report/tmp'
):
# 列出对应文件夹的数据
if
'json'
in
one
:
os
.
remove
(
f
'../../report/tmp/{one}'
)
pytest
.
main
([
'test_riskMonitar.py'
,
'-s'
,
'--alluredir'
,
'../../report/tmp'
])
# # 启动默认浏览器打开报告
os
.
system
(
'allure serve ../../report/tmp'
)
test_case_data/bmy/bmy_case.xlsx
View file @
9e378e80
No preview for this file type
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