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
ef5c5454
Commit
ef5c5454
authored
May 18, 2021
by
fanxun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用例拆解3
parent
b50214bf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
9 deletions
+32
-9
test_case/bmc/test_credit_score.py
+7
-7
test_case/bmc/test_vehicle_steward.py
+25
-2
test_case_data/bmc/bmc_vehicle_steward_29_39_20210513.xlsx
+0
-0
No files found.
test_case/bmc/test_credit_score.py
View file @
ef5c5454
...
@@ -12,7 +12,7 @@ from config import BMCConfig
...
@@ -12,7 +12,7 @@ from config import BMCConfig
# @allure.feature("信用分")
# @allure.feature("信用分")
class
TestCreditScore
():
class
TestCreditScore
():
workBook
=
xlrd
.
open_workbook
(
f
'{BMCConfig.root_path}/test_case_data/bmc/bmc_credit_score_20210513.xlsx'
)
#
workBook = xlrd.open_workbook(f'{BMCConfig.root_path}/test_case_data/bmc/bmc_credit_score_20210513.xlsx')
# inData = get_excelData(workBook, '信用分', 'creditscore')[0]
# inData = get_excelData(workBook, '信用分', 'creditscore')[0]
def
bmc_login_fixture
(
self
):
def
bmc_login_fixture
(
self
):
...
@@ -43,7 +43,7 @@ class TestCreditScore():
...
@@ -43,7 +43,7 @@ class TestCreditScore():
# print(expectData)
# print(expectData)
#res = requests.post(url = url,headers =headers,json =req_data )
#res = requests.post(url = url,headers =headers,json =req_data )
res
=
request_main
(
url
=
url
,
headers
=
None
,
method
=
method
,
data
=
req_data
,
has_token
=
False
)
res
=
request_main
(
url
=
url
,
headers
=
None
,
method
=
method
,
data
=
req_data
,
has_token
=
False
)
print
(
res
[
'data'
][
'canSignInToday'
]
)
print
(
res
)
# assert res['code'] == expectData['code']
# assert res['code'] == expectData['code']
...
@@ -53,11 +53,11 @@ if __name__ == '__main__':
...
@@ -53,11 +53,11 @@ if __name__ == '__main__':
# r'--alluredir=D:\项目\接口自动化\InterfaceAutoTest\report', '--clean-alluredir'])
# r'--alluredir=D:\项目\接口自动化\InterfaceAutoTest\report', '--clean-alluredir'])
#
#
# os.system('allure serve D:\项目\接口自动化\InterfaceAutoTest\\report')
# os.system('allure serve D:\项目\接口自动化\InterfaceAutoTest\\report')
workBook
=
xlrd
.
open_workbook
(
f
'{BMCConfig.root_path}/test_case_data/bmc/bmc_
testcase01
_20210513.xlsx'
)
workBook
=
xlrd
.
open_workbook
(
f
'{BMCConfig.root_path}/test_case_data/bmc/bmc_
vehicle_steward_29_39
_20210513.xlsx'
)
inData
=
get_excelData
(
workBook
,
'
积分商城'
,
'getsignIntegral'
)[
0
]
inData
=
get_excelData
(
workBook
,
'
出行服务'
,
'agreevehiclesteward'
)
#
print(inData)
print
(
inData
)
TestCreditScore
()
.
bmc_login_fixture
()
#
TestCreditScore().bmc_login_fixture()
TestCreditScore
()
.
test_creditscore
(
inData
)
#
TestCreditScore().test_creditscore(inData)
# res = requests.get('http://testbmcapp.hikcreate.com/credit/myCredit/V2', params={"bCityCode":"520100","bNetTag":"trf_mgt"},
# res = requests.get('http://testbmcapp.hikcreate.com/credit/myCredit/V2', params={"bCityCode":"520100","bNetTag":"trf_mgt"},
# headers= {
# headers= {
...
...
test_case/bmc/test_vehicle_steward.py
View file @
ef5c5454
__author__
=
'fanxun'
__author__
=
'fanxun'
__data__
=
"2021-05-18 14:41"
__data__
=
"2021-05-18 14:41"
"""出行服务"""
\ No newline at end of file
import
allure
,
xlrd
,
pytest
from
config
import
BMCConfig
from
common.utils.getExcelData
import
get_excelData
from
common.tools
import
request_main
@allure.feature
(
"出行服务"
)
class
TestCreditScore
():
workBook
=
xlrd
.
open_workbook
(
f
'{BMCConfig.root_path}/test_case_data/bmc/bmc_vehicle_steward_29_39_20210513.xlsx'
)
@allure.story
(
"获取用户授权"
)
@allure.link
(
"http://yapi.hikcreate.com/project/31/interface/api/75421"
)
@allure.description
(
"/vehicle/steward/authorization/authorizationOfUse"
)
@allure.title
(
"{inData[testPoint]}"
)
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
'出行服务'
,
'authorizationOfUsevehicle_steward'
))
def
test_my_integral
(
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
=
url
,
headers
=
headers
,
method
=
method
,
data
=
req_data
,
has_token
=
False
)
assert
res
[
'code'
]
==
expectData
[
'code'
]
\ No newline at end of file
test_case_data/bmc/bmc_vehicle_steward_29_39_20210513.xlsx
View file @
ef5c5454
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