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
a497c6a4
Commit
a497c6a4
authored
Jun 22, 2021
by
taoke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
电动车添加用例
parent
ad2f30c5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
8 deletions
+41
-8
test_case/bmc/test_ElectricBicycle.py
+41
-8
test_case_data/bmc/bmc_ElectricBicycle_20210531.xlsx
+0
-0
No files found.
test_case/bmc/test_ElectricBicycle.py
View file @
a497c6a4
...
...
@@ -17,14 +17,13 @@ headers = BMCConfig.headers
headers
[
'Pvt-Token'
]
=
BMCConfig
.
bmc_pvt_token
headers
[
'Token'
]
=
BMCConfig
.
bmc_token
@pytest.fixture
(
scope
=
'function'
)
def
avatarUpdate_del
()
:
#修改头像清除
# mysql=BaseConfig.test_mysql_215
# mysql = MYSQL(*mysql)
mysql
=
MYSQL
(
host
=
"10.197.236.190"
,
port
=
3306
,
user
=
"root"
,
pwd
=
"123456"
,
db
=
"edl_private"
)
# mysql = MYSQL("10.197.236.215", 3306, "root", "DataCenter@!hik", "edl_public")
def
applySubmit_del
()
:
# 号牌换领初始化_
mysql
=
MYSQL
(
*
BaseConfig
.
test_mysql
)
mysql
.
ExecuNonQuery
(
"DELETE FROM
edl_private.driving_license_image_audit WHERE name='自动化
';"
)
# 删除驾驶员
"DELETE FROM
db_gy_dmsmp.elec_bicy_change_apply WHERE old_plate_num='贵州A20065
';"
)
# 删除驾驶员
RedisString
(
0
)
.
delete_key
(
"bmc:c1:dl_img:uid"
)
yield
...
...
@@ -479,7 +478,6 @@ class TestDrivingLicense( ) :
allure
.
attach
(
f
"{res}"
,
"响应结果"
,
allure
.
attachment_type
.
TEXT
)
assert
res
[
'code'
]
==
expectData
[
'code'
]
@pytest.mark.scoreDetail
@allure.story
(
"预约记录查询"
)
@allure.link
(
"http://yapi.hikcreate.com/project/32/interface/api/78666"
)
@allure.description
(
"接口:/pvtapi/elecBicyChange/apply/elecBicyApplyPage,creator:胥键雪,autoCreator:taoke"
)
...
...
@@ -496,10 +494,45 @@ class TestDrivingLicense( ) :
allure
.
attach
(
f
"{res}"
,
"响应结果"
,
allure
.
attachment_type
.
TEXT
)
assert
res
[
'code'
]
==
expectData
[
'code'
]
@pytest.mark.scoreDetail
@pytest.mark.usefixtures
(
"applySubmit_del"
)
@allure.story
(
"提交申请"
)
@allure.link
(
"http://yapi.hikcreate.com/project/32/interface/api/78476"
)
@allure.description
(
"接口:/pvtapi/elecBicyChange/apply/submit,creator:胥键雪,autoCreator:taoke"
)
@allure.title
(
"{inData[testPoint]}"
)
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
'电动车'
,
'applySubmit'
))
def
test_applySubmit
(
self
,
inData
):
url
=
f
"{BMCConfig().host}{inData['url']}"
method
=
inData
[
'method'
]
req_data
=
inData
[
'reqData'
]
expectData
=
inData
[
'expectData'
]
headers
=
inData
[
'headers'
]
# 请求
res
=
request_main
(
url
,
headers
,
method
,
req_data
)
allure
.
attach
(
f
"{res}"
,
"响应结果"
,
allure
.
attachment_type
.
TEXT
)
assert
res
[
'code'
]
==
expectData
[
'code'
]
@pytest.mark.scoreDetail
@allure.story
(
"撤回申请"
)
@allure.link
(
"http://yapi.hikcreate.com/project/32/interface/api/78478"
)
@allure.description
(
"接口:/pvtapi/elecBicyChange/apply/recall,creator:胥键雪,autoCreator:taoke"
)
@allure.title
(
"{inData[testPoint]}"
)
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
'电动车'
,
'applyRecall'
))
def
test_applyRecall
(
self
,
inData
):
url
=
f
"{BMCConfig().host}{inData['url']}"
method
=
inData
[
'method'
]
req_data
=
inData
[
'reqData'
]
expectData
=
inData
[
'expectData'
]
headers
=
inData
[
'headers'
]
# 请求
res
=
request_main
(
url
,
headers
,
method
,
req_data
)
allure
.
attach
(
f
"{res}"
,
"响应结果"
,
allure
.
attachment_type
.
TEXT
)
assert
res
[
'code'
]
==
expectData
[
'code'
]
if
__name__
==
'__main__'
:
for
one
in
os
.
listdir
(
'../../report/tmp'
):
# '-m','scoreDetail' ,
if
'json'
in
one
:
os
.
remove
(
f
'../../report/tmp/{one}'
)
pytest
.
main
([
'test_ElectricBicycle.py'
,
'-s'
,
'-m'
,
'scoreDetail'
,
'--alluredir'
,
'../../report/tmp'
])
pytest
.
main
([
'test_ElectricBicycle.py'
,
'-s'
,
'-m'
,
'scoreDetail'
,
'--alluredir'
,
'../../report/tmp'
])
os
.
system
(
'allure serve ../../report/tmp'
)
test_case_data/bmc/bmc_ElectricBicycle_20210531.xlsx
View file @
a497c6a4
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