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
cbbd9676
Commit
cbbd9676
authored
Jun 02, 2021
by
taoke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
电动车添加用例
parent
23a0eb2b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
100 additions
and
3 deletions
+100
-3
test_case/bmc/test_ElectricBicycle.py
+100
-3
test_case_data/bmc/bmc_ElectricBicycle_20210531.xlsx
+0
-0
No files found.
test_case/bmc/test_ElectricBicycle.py
View file @
cbbd9676
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
#编码: -- coding: utf-8 --
#编码: -- coding: utf-8 --
#版本: !python3.7
#版本: !python3.7
import
pytest
,
allure
,
xlrd
,
requests
,
os
import
pytest
,
allure
,
xlrd
,
requests
,
os
,
datetime
,
random
from
common.utils.getExcelData
import
get_excelData
from
common.utils.getExcelData
import
get_excelData
from
service.login
import
BMY
from
service.login
import
BMY
from
common.tools
import
request_main
from
common.tools
import
request_main
...
@@ -156,10 +156,10 @@ class TestDrivingLicense():
...
@@ -156,10 +156,10 @@ class TestDrivingLicense():
allure
.
attach
(
f
"{res}"
,
"响应结果"
,
allure
.
attachment_type
.
TEXT
)
allure
.
attach
(
f
"{res}"
,
"响应结果"
,
allure
.
attachment_type
.
TEXT
)
assert
res
[
'code'
]
==
expectData
[
'code'
]
assert
res
[
'code'
]
==
expectData
[
'code'
]
@pytest.mark.scoreDetail
@allure.story
(
"地址选择"
)
@allure.story
(
"地址选择"
)
@allure.link
(
"http://yapi.hikcreate.com/project/32/interface/api/45572"
)
@allure.link
(
"http://yapi.hikcreate.com/project/32/interface/api/45572"
)
@allure.description
(
"接口:/
pvtapi/sys/dict/list
,creator:胥键雪,autoCreator:taoke"
)
@allure.description
(
"接口:/
/electricBicycle/apply/address/addressSelector
,creator:胥键雪,autoCreator:taoke"
)
@allure.title
(
"{inData[testPoint]}"
)
@allure.title
(
"{inData[testPoint]}"
)
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
'电动车'
,
'addressSelector'
))
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
'电动车'
,
'addressSelector'
))
def
test_addressSelector
(
self
,
inData
):
def
test_addressSelector
(
self
,
inData
):
...
@@ -173,6 +173,103 @@ class TestDrivingLicense():
...
@@ -173,6 +173,103 @@ class TestDrivingLicense():
allure
.
attach
(
f
"{res}"
,
"响应结果"
,
allure
.
attachment_type
.
TEXT
)
allure
.
attach
(
f
"{res}"
,
"响应结果"
,
allure
.
attachment_type
.
TEXT
)
assert
res
[
'code'
]
==
expectData
[
'code'
]
assert
res
[
'code'
]
==
expectData
[
'code'
]
@allure.story
(
"车架号是否存在"
)
@allure.link
(
"http://yapi.hikcreate.com/project/32/interface/api/45032"
)
@allure.description
(
"接口:/pvtapi/electricBicycle/getBikeCccInfo,creator:胥键雪,autoCreator:taoke"
)
@allure.title
(
"{inData[testPoint]}"
)
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
'电动车'
,
'getBikeCccInfo'
))
def
test_getBikeCccInfo
(
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'
]
@allure.story
(
"检查车架号和身份证号"
)
@allure.link
(
"http://yapi.hikcreate.com/project/32/interface/api/45540"
)
@allure.description
(
"接口:/pvtapi/electricBicycle/checkStatus,creator:胥键雪,autoCreator:taoke"
)
@allure.title
(
"{inData[testPoint]}"
)
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
'电动车'
,
'checkStatus'
))
def
test_checkStatus
(
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'
]
@allure.story
(
"车管所列表"
)
@allure.link
(
"http://yapi.hikcreate.com/project/32/interface/api/45216"
)
@allure.description
(
"接口:/pvtapi/electricBicycle/dmv/list,creator:胥键雪,autoCreator:taoke"
)
@allure.title
(
"{inData[testPoint]}"
)
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
'电动车'
,
'dmvList'
))
def
test_dmvList
(
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'
]
@allure.story
(
"获取可预约日期的列表"
)
@allure.link
(
"http://yapi.hikcreate.com/project/32/interface/api/45508"
)
@allure.description
(
"接口:/pvtapi/electricBicycle/exchangeLicensePlate/getDataList,creator:胥键雪,autoCreator:taoke"
)
@allure.title
(
"{inData[testPoint]}"
)
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
'电动车'
,
'getDataList'
))
def
test_getDataList
(
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/44776"
)
@allure.description
(
"接口:/pvtapi/electricBicycle/apply/newGB/submit,creator:胥键雪,autoCreator:taoke"
)
@allure.title
(
"{inData[testPoint]}"
)
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
'电动车'
,
'newGBsubmit'
))
def
test_newGBsubmit
(
self
,
inData
):
url
=
f
"{BMCConfig().host}{inData['url']}"
method
=
inData
[
'method'
]
req_data
=
inData
[
'reqData'
]
expectData
=
inData
[
'expectData'
]
headers
=
inData
[
'headers'
]
"""处理"""
today
=
datetime
.
date
.
today
()
if
today
.
isoweekday
()
in
[
5
,
6
,
7
]:
today
+=
datetime
.
timedelta
(
days
=
8
-
today
.
isoweekday
())
# 需要是工作日
appointDate
=
str
(
today
)
else
:
today
+=
datetime
.
timedelta
(
days
=
1
)
# 放管服设置需提前预约一天
appointDate
=
str
(
today
)
print
(
appointDate
)
frameNumber
=
f
"{random.randint(100, 999)}757890668{random.randint(100, 999)}"
req_data
[
'appointDate'
]
=
appointDate
req_data
[
'frameNumber'
]
=
frameNumber
res
=
request_main
(
url
,
headers
,
method
,
req_data
)
allure
.
attach
(
f
"{res}"
,
"响应结果"
,
allure
.
attachment_type
.
TEXT
)
assert
res
[
'code'
]
==
expectData
[
'code'
]
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
for
one
in
os
.
listdir
(
'../../report/tmp'
):
# '-m','scoreDetail' ,
for
one
in
os
.
listdir
(
'../../report/tmp'
):
# '-m','scoreDetail' ,
if
'json'
in
one
:
if
'json'
in
one
:
...
...
test_case_data/bmc/bmc_ElectricBicycle_20210531.xlsx
View file @
cbbd9676
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