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
cf8eb6f9
Commit
cf8eb6f9
authored
May 17, 2021
by
fanxun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
积分商城用例实现
parent
68a79a52
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
307 additions
and
39 deletions
+307
-39
test_case/bmc/conftest.py
+4
-4
test_case/bmc/test_credit_score.py
+62
-18
test_case/bmc/test_integral.py
+241
-17
test_case_data/bmc/bmc_testcase01_20210513.xlsx
+0
-0
No files found.
test_case/bmc/conftest.py
View file @
cf8eb6f9
...
@@ -14,10 +14,10 @@ def bmc_login_fixture():
...
@@ -14,10 +14,10 @@ def bmc_login_fixture():
indata
=
{
"phone"
:
"17822000000"
,
indata
=
{
"phone"
:
"17822000000"
,
"encodedGesture"
:
"67e6d10010533eed4bbe9659863bf6ee"
}
"encodedGesture"
:
"67e6d10010533eed4bbe9659863bf6ee"
}
res
=
BMC
()
.
bmc_login
(
indata
)
res
=
BMC
()
.
bmc_login
(
indata
)
setattr
(
BMCConfig
,
'bmc_token'
,
res
[
0
])
#
setattr(BMCConfig, 'bmc_token', res[0])
setattr
(
BMCConfig
,
'bmc_pvt_token'
,
res
[
1
])
#
setattr(BMCConfig, 'bmc_pvt_token', res[1])
#
BMCConfig.headers['Pvt-Token'] = res[1]
BMCConfig
.
headers
[
'Pvt-Token'
]
=
res
[
1
]
#
BMCConfig.headers['Token'] = res[0]
BMCConfig
.
headers
[
'Token'
]
=
res
[
0
]
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
...
...
test_case/bmc/test_credit_score.py
View file @
cf8eb6f9
from
service.login
import
BMC
__author__
=
'fanxun'
__author__
=
'fanxun'
__data__
=
"2021-05-14 14:13"
__data__
=
"2021-05-14 14:13"
import
pytest
,
allure
,
xlrd
,
os
import
pytest
,
allure
,
xlrd
,
os
,
requests
import
config
import
config
from
common.utils.getExcelData
import
get_excelData
from
common.utils.getExcelData
import
get_excelData
from
common.tools
import
request_main
from
common.tools
import
request_main
...
@@ -9,30 +11,72 @@ from config import BMCConfig
...
@@ -9,30 +11,72 @@ 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_testcase01_20210513.xlsx')
workBook
=
xlrd
.
open_workbook
(
f
'{BMCConfig.root_path}/test_case_data/bmc/bmc_testcase01_20210513.xlsx'
)
#
inData
=
get_excelData
(
workBook
,
'信用分'
,
'creditscore'
)[
0
]
def
bmc_login_fixture
(
self
):
"""bmc登录获取token"""
indata
=
{
"phone"
:
"17822000000"
,
"encodedGesture"
:
"67e6d10010533eed4bbe9659863bf6ee"
}
res
=
BMC
()
.
bmc_login
(
indata
)
# setattr(BMCConfig, 'bmc_token', res[0])
# setattr(BMCConfig, 'bmc_pvt_token', res[1])
BMCConfig
.
headers
[
'Pvt-Token'
]
=
res
[
1
]
BMCConfig
.
headers
[
'Token'
]
=
res
[
0
]
print
(
'Pvt-Token=========================='
,
res
[
1
])
print
(
'Token=========================='
,
res
[
0
])
# @allure.story("信用分")
# @allure.story("信用分")
# @allure.title("{inData[testPoint]}")
# @allure.title("{inData[testPoint]}")
# @allure.testcase("{inData[yapiAddress]}")
# @allure.testcase("{inData[yapiAddress]}")
# @allure.description("url:/auth/login 。。。。")
# @allure.description("url:/auth/login 。。。。")
# @pytest.mark.parametrize("inData", get_excelData(workBook, '信用分', 'creditscore'))
# @pytest.mark.parametrize("inData", get_excelData(workBook, '信用分', 'creditscore'))
# def test_creditscore(self,inData):
def
test_creditscore
(
self
,
inData
):
# url = f"{BMCConfig().host}{inData['url']}"
url
=
f
"{BMCConfig().host}{inData['url']}"
# method = inData['method']
method
=
inData
[
'method'
]
# req_data = inData['reqData']
req_data
=
inData
[
'reqData'
]
# expectData = inData['expectData']
expectData
=
inData
[
'expectData'
]
# headers = config.BMCConfig.headers
headers
=
config
.
BMCConfig
.
headers
# #res = requests.post(url = url,headers =headers,json =req_data )
print
(
url
)
# res = request_main(url=url, headers=headers, method=method, data=req_data, has_token=True)
# print(config.BMCConfig.headers)
#res = requests.post(url = url,headers =headers,json =req_data )
# assert res['code'] == expectData['code']
res
=
request_main
(
url
=
url
,
headers
=
headers
,
method
=
method
,
data
=
req_data
,
has_token
=
True
)
print
(
res
)
# assert res['code'] == expectData['code']
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
pytest
.
main
([
'-s'
,
'-v'
,
'test_credit_score.py'
,
# pytest.main(['-s', '-v', 'test_credit_score.py',
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'
)
inData
=
get_excelData
(
workBook
,
'积分商城'
,
'Integral'
)[
0
]
TestCreditScore
()
.
bmc_login_fixture
()
TestCreditScore
()
.
test_creditscore
(
inData
)
# res = requests.get('http://testbmcapp.hikcreate.com/credit/myCredit/V2', params={"bCityCode":"520100","bNetTag":"trf_mgt"},
# headers= {
# 'City-Code': "520100",
# 'Device-Brand': "vivo",
# 'Device-Code': "000000001e167ed7000000001e167ed7",
# 'Device-Model': "vivo vivo X20",
# 'Device-Name': "vivo+X20",
# 'Device-Type': "Android",
# 'Mac': "38:6E:A2:A0:0E:AF",
# 'mimeType': "application/json",
# 'Net': "wifi",
# 'OS-Type': "Android",
# 'OS-Version': "27",
# 'Pvt-Token': "eyJhbGciOiJIUzI1NiIsInppcCI6IkRFRiJ9.eNpcjEEKgDAMBP-Ss0hS2kT7CP9Qa8CiVbB6Ev9uD56c0w4sc0MqBTzMaYmHhlPbuGdoIIUTPLEhQ2xZGijXWG_OICFRL4h1sRXnLTrHnccPUmLRSf5em8e-6hCy1k6YctrgeQEAAP__.GcCYQ7-NG3rSDLFUvgRVDS94QpYDBtisEuYSY4V_wAw",
# 'Resolution': "2034x1080",
# 'Token': "eTir/N9Z7ddMjuvo8M5MJWRLAWrlJ7pUlUe2+eYszHJumBknucBL6nuzBdYWFTWIpFiiDNjxV7Ehw32usHdd6VMFs0k7Rm70FcoDPkTEvyUkwhnN2GHlnk8nhxKvk3AJFDAj6JLl1Mr9OVj9I6TcjpQTzzyjzZjteIreMsUDwJW0Se+CW/teW+1DE70HDMY+0lrm01ftft627SGVsnr6AqxLF3KF/y+GyxKNrwKO29n8T33RFdWgcHs+fji46E/rBdSxxxJHjyClxnJOIoiU3DxZ/SoyNPn5X3CMGUio6MumAfJSQNh6Onk337G2tMum",
# 'Version': "2.2.6"
# })
# print(res.json())
test_case/bmc/test_integral.py
View file @
cf8eb6f9
...
@@ -8,24 +8,248 @@ from common.tools import request_main
...
@@ -8,24 +8,248 @@ from common.tools import request_main
from
config
import
BMCConfig
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_testcase01_20210513.xlsx')
workBook
=
xlrd
.
open_workbook
(
f
'{BMCConfig.root_path}/test_case_data/bmc/bmc_testcase01_20210513.xlsx'
)
#
# @allure.story("积分商城")
@allure.story
(
"查询我的积分"
)
# @allure.title("{inData[testPoint]}")
@allure.link
(
"http://yapi.hikcreate.com/project/31/interface/api/55860"
)
# @pytest.mark.parametrize("inData", get_excelData(workBook, '积分商城', 'Integral'))
@allure.description
(
"/integral/center/myIntegral"
)
# def test_creditscore(self,inData):
@allure.title
(
"{inData[testPoint]}"
)
# url = f"{BMCConfig().host}{inData['url']}"
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
'积分商城'
,
'myIntegral'
))
# method = inData['method']
def
test_creditscore
(
self
,
inData
):
# req_data = inData['reqData']
url
=
f
"{BMCConfig().host}{inData['url']}"
# expectData = inData['expectData']
method
=
inData
[
'method'
]
# headers = config.BMCConfig.headers
req_data
=
inData
[
'reqData'
]
# #res = requests.post(url = url,headers =headers,json =req_data )
expectData
=
inData
[
'expectData'
]
# res = request_main(url=url, headers=headers, method=method, data=req_data, has_token=True)
headers
=
config
.
BMCConfig
.
headers
# print(res)
res
=
request_main
(
url
=
url
,
headers
=
headers
,
method
=
method
,
data
=
req_data
,
has_token
=
True
)
# assert res['code'] == expectData['code']
assert
res
[
'code'
]
==
expectData
[
'code'
]
@allure.story
(
"签到"
)
@allure.link
(
"http://yapi.hikcreate.com/project/31/interface/api/55878"
)
@allure.description
(
"/integral/center/sign"
)
@allure.title
(
"{inData[testPoint]}"
)
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
'积分商城'
,
'postSignIntegral'
))
def
test_creditscore
(
self
,
inData
):
url
=
f
"{BMCConfig().host}{inData['url']}"
method
=
inData
[
'method'
]
req_data
=
inData
[
'reqData'
]
expectData
=
inData
[
'expectData'
]
headers
=
config
.
BMCConfig
.
headers
res
=
request_main
(
url
=
url
,
headers
=
headers
,
method
=
method
,
data
=
req_data
,
has_token
=
True
)
assert
res
[
'code'
]
==
expectData
[
'code'
]
@allure.story
(
"查询我的签到情况"
)
@allure.link
(
"http://yapi.hikcreate.com/project/31/interface/api/55869"
)
@allure.description
(
"/integral/center/sign"
)
@allure.title
(
"{inData[testPoint]}"
)
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
'积分商城'
,
'getsignIntegral'
))
def
test_creditscore
(
self
,
inData
):
url
=
f
"{BMCConfig().host}{inData['url']}"
method
=
inData
[
'method'
]
req_data
=
inData
[
'reqData'
]
expectData
=
inData
[
'expectData'
]
headers
=
config
.
BMCConfig
.
headers
res
=
request_main
(
url
=
url
,
headers
=
headers
,
method
=
method
,
data
=
req_data
,
has_token
=
True
)
assert
res
[
'code'
]
==
expectData
[
'code'
]
@allure.story
(
"查询待领取积分清单"
)
@allure.link
(
"http://yapi.hikcreate.com/project/31/interface/api/55887"
)
@allure.description
(
"/integral/center/recommendedTasks"
)
@allure.title
(
"{inData[testPoint]}"
)
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
'积分商城'
,
'taskIntegral'
))
def
test_creditscore
(
self
,
inData
):
url
=
f
"{BMCConfig().host}{inData['url']}"
method
=
inData
[
'method'
]
req_data
=
inData
[
'reqData'
]
expectData
=
inData
[
'expectData'
]
headers
=
config
.
BMCConfig
.
headers
res
=
request_main
(
url
=
url
,
headers
=
headers
,
method
=
method
,
data
=
req_data
,
has_token
=
True
)
assert
res
[
'code'
]
==
expectData
[
'code'
]
@allure.story
(
"查询积分商品"
)
@allure.link
(
"http://yapi.hikcreate.com/project/31/interface/api/57138"
)
@allure.description
(
"/integral/center/integralGoods"
)
@allure.title
(
"{inData[testPoint]}"
)
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
'积分商城'
,
'goodsIntegral'
))
def
test_creditscore
(
self
,
inData
):
url
=
f
"{BMCConfig().host}{inData['url']}"
method
=
inData
[
'method'
]
req_data
=
inData
[
'reqData'
]
expectData
=
inData
[
'expectData'
]
headers
=
config
.
BMCConfig
.
headers
res
=
request_main
(
url
=
url
,
headers
=
headers
,
method
=
method
,
data
=
req_data
,
has_token
=
True
)
assert
res
[
'code'
]
==
expectData
[
'code'
]
@allure.story
(
"查询积分规则"
)
@allure.link
(
"http://yapi.hikcreate.com/project/31/interface/api/64302"
)
@allure.description
(
"/integral/center/rule"
)
@allure.title
(
"{inData[testPoint]}"
)
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
'积分商城'
,
'ruleIntegral'
))
def
test_creditscore
(
self
,
inData
):
url
=
f
"{BMCConfig().host}{inData['url']}"
method
=
inData
[
'method'
]
req_data
=
inData
[
'reqData'
]
expectData
=
inData
[
'expectData'
]
headers
=
config
.
BMCConfig
.
headers
res
=
request_main
(
url
=
url
,
headers
=
headers
,
method
=
method
,
data
=
req_data
,
has_token
=
True
)
assert
res
[
'code'
]
==
expectData
[
'code'
]
@allure.story
(
"设置签到提醒开关"
)
@allure.link
(
"http://yapi.hikcreate.com/project/31/interface/api/56418"
)
@allure.description
(
"/integral/center/sign/warnSwitch"
)
@allure.title
(
"{inData[testPoint]}"
)
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
'积分商城'
,
'switchIntegral'
))
def
test_creditscore
(
self
,
inData
):
url
=
f
"{BMCConfig().host}{inData['url']}"
method
=
inData
[
'method'
]
req_data
=
inData
[
'reqData'
]
expectData
=
inData
[
'expectData'
]
headers
=
config
.
BMCConfig
.
headers
res
=
request_main
(
url
=
url
,
headers
=
headers
,
method
=
method
,
data
=
req_data
,
has_token
=
True
)
assert
res
[
'code'
]
==
expectData
[
'code'
]
@allure.story
(
"任务中心主页"
)
@allure.link
(
"http://yapi.hikcreate.com/project/31/interface/api/56427"
)
@allure.description
(
"/integral/task/info"
)
@allure.title
(
"{inData[testPoint]}"
)
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
'积分商城'
,
'infoIntegral'
))
def
test_creditscore
(
self
,
inData
):
url
=
f
"{BMCConfig().host}{inData['url']}"
method
=
inData
[
'method'
]
req_data
=
inData
[
'reqData'
]
expectData
=
inData
[
'expectData'
]
headers
=
config
.
BMCConfig
.
headers
res
=
request_main
(
url
=
url
,
headers
=
headers
,
method
=
method
,
data
=
req_data
,
has_token
=
True
)
assert
res
[
'code'
]
==
expectData
[
'code'
]
@allure.story
(
"领取积分"
)
@allure.link
(
"http://yapi.hikcreate.com/project/31/interface/api/56436"
)
@allure.description
(
"/integral/task/receive"
)
@allure.title
(
"{inData[testPoint]}"
)
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
'积分商城'
,
'receiveIntegral'
))
def
test_creditscore
(
self
,
inData
):
url
=
f
"{BMCConfig().host}{inData['url']}"
method
=
inData
[
'method'
]
req_data
=
inData
[
'reqData'
]
expectData
=
inData
[
'expectData'
]
headers
=
config
.
BMCConfig
.
headers
res
=
request_main
(
url
=
url
,
headers
=
headers
,
method
=
method
,
data
=
req_data
,
has_token
=
True
)
assert
res
[
'code'
]
==
expectData
[
'code'
]
@allure.story
(
"获取关注信息"
)
@allure.link
(
"http://yapi.hikcreate.com/project/31/interface/api/56841"
)
@allure.description
(
"/integral/task/getFollowInfo"
)
@allure.title
(
"{inData[testPoint]}"
)
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
'积分商城'
,
'FollowInfoIntegral'
))
def
test_creditscore
(
self
,
inData
):
url
=
f
"{BMCConfig().host}{inData['url']}"
method
=
inData
[
'method'
]
req_data
=
inData
[
'reqData'
]
expectData
=
inData
[
'expectData'
]
headers
=
config
.
BMCConfig
.
headers
res
=
request_main
(
url
=
url
,
headers
=
headers
,
method
=
method
,
data
=
req_data
,
has_token
=
True
)
assert
res
[
'code'
]
==
expectData
[
'code'
]
@allure.story
(
"商城中的商品"
)
@allure.link
(
"http://yapi.hikcreate.com/project/31/interface/api/55896"
)
@allure.description
(
"/integral/mall/goods/list"
)
@allure.title
(
"{inData[testPoint]}"
)
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
'积分商城'
,
'listIntegral'
))
def
test_creditscore
(
self
,
inData
):
url
=
f
"{BMCConfig().host}{inData['url']}"
method
=
inData
[
'method'
]
req_data
=
inData
[
'reqData'
]
expectData
=
inData
[
'expectData'
]
headers
=
config
.
BMCConfig
.
headers
res
=
request_main
(
url
=
url
,
headers
=
headers
,
method
=
method
,
data
=
req_data
,
has_token
=
True
)
assert
res
[
'code'
]
==
expectData
[
'code'
]
@allure.story
(
"商品的详情"
)
@allure.link
(
"http://yapi.hikcreate.com/project/31/interface/api/56076"
)
@allure.description
(
"/integral/mall/goods/detail"
)
@allure.title
(
"{inData[testPoint]}"
)
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
'积分商城'
,
'detailIntegral'
))
def
test_creditscore
(
self
,
inData
):
url
=
f
"{BMCConfig().host}{inData['url']}"
method
=
inData
[
'method'
]
req_data
=
inData
[
'reqData'
]
expectData
=
inData
[
'expectData'
]
headers
=
config
.
BMCConfig
.
headers
res
=
request_main
(
url
=
url
,
headers
=
headers
,
method
=
method
,
data
=
req_data
,
has_token
=
True
)
assert
res
[
'code'
]
==
expectData
[
'code'
]
@allure.story
(
"兑换商品接口"
)
@allure.link
(
"http://yapi.hikcreate.com/project/31/interface/api/56085"
)
@allure.description
(
"/integral/mall/goods/exchange"
)
@allure.title
(
"{inData[testPoint]}"
)
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
'积分商城'
,
'exchangeIntegral'
))
def
test_creditscore
(
self
,
inData
):
url
=
f
"{BMCConfig().host}{inData['url']}"
method
=
inData
[
'method'
]
req_data
=
inData
[
'reqData'
]
expectData
=
inData
[
'expectData'
]
headers
=
config
.
BMCConfig
.
headers
res
=
request_main
(
url
=
url
,
headers
=
headers
,
method
=
method
,
data
=
req_data
,
has_token
=
True
)
assert
res
[
'code'
]
==
expectData
[
'code'
]
@allure.story
(
"查询商品的适用门店列表"
)
@allure.link
(
"http://yapi.hikcreate.com/project/31/interface/api/56094"
)
@allure.description
(
"/integral/mall/goods/applicableStores"
)
@allure.title
(
"{inData[testPoint]}"
)
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
'积分商城'
,
'applicableStoresIntegral'
))
def
test_creditscore
(
self
,
inData
):
url
=
f
"{BMCConfig().host}{inData['url']}"
method
=
inData
[
'method'
]
req_data
=
inData
[
'reqData'
]
expectData
=
inData
[
'expectData'
]
headers
=
config
.
BMCConfig
.
headers
res
=
request_main
(
url
=
url
,
headers
=
headers
,
method
=
method
,
data
=
req_data
,
has_token
=
True
)
assert
res
[
'code'
]
==
expectData
[
'code'
]
@allure.story
(
"查询兑换记录"
)
@allure.link
(
"http://yapi.hikcreate.com/project/31/interface/api/56103"
)
@allure.description
(
"/integral/mall/exchangeRecord/list"
)
@allure.title
(
"{inData[testPoint]}"
)
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
'积分商城'
,
'exchangeRecordListIntegral'
))
def
test_creditscore
(
self
,
inData
):
url
=
f
"{BMCConfig().host}{inData['url']}"
method
=
inData
[
'method'
]
req_data
=
inData
[
'reqData'
]
expectData
=
inData
[
'expectData'
]
headers
=
config
.
BMCConfig
.
headers
res
=
request_main
(
url
=
url
,
headers
=
headers
,
method
=
method
,
data
=
req_data
,
has_token
=
True
)
assert
res
[
'code'
]
==
expectData
[
'code'
]
@allure.story
(
"查询兑换记录详情"
)
@allure.link
(
"http://yapi.hikcreate.com/project/31/interface/api/57354"
)
@allure.description
(
"/integral/mall/exchangeRecord/detail"
)
@allure.title
(
"{inData[testPoint]}"
)
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
'积分商城'
,
'exchangeRecordDetailIntegral'
))
def
test_creditscore
(
self
,
inData
):
url
=
f
"{BMCConfig().host}{inData['url']}"
method
=
inData
[
'method'
]
req_data
=
inData
[
'reqData'
]
expectData
=
inData
[
'expectData'
]
headers
=
config
.
BMCConfig
.
headers
res
=
request_main
(
url
=
url
,
headers
=
headers
,
method
=
method
,
data
=
req_data
,
has_token
=
True
)
assert
res
[
'code'
]
==
expectData
[
'code'
]
@allure.story
(
"关注成功回调"
)
@allure.link
(
"http://yapi.hikcreate.com/project/31/interface/api/61233"
)
@allure.description
(
"/integral/task/focusSuccess"
)
@allure.title
(
"{inData[testPoint]}"
)
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
'积分商城'
,
'focusSuccessIntegral'
))
def
test_creditscore
(
self
,
inData
):
url
=
f
"{BMCConfig().host}{inData['url']}"
method
=
inData
[
'method'
]
req_data
=
inData
[
'reqData'
]
expectData
=
inData
[
'expectData'
]
headers
=
config
.
BMCConfig
.
headers
res
=
request_main
(
url
=
url
,
headers
=
headers
,
method
=
method
,
data
=
req_data
,
has_token
=
True
)
assert
res
[
'code'
]
==
expectData
[
'code'
]
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
pytest
.
main
([
'-s'
,
'-v'
,
'test_integral.py'
,
pytest
.
main
([
'-s'
,
'-v'
,
'test_integral.py'
,
r'--alluredir=D:\项目\接口自动化\InterfaceAutoTest\report'
,
'--clean-alluredir'
])
r'--alluredir=D:\项目\接口自动化\InterfaceAutoTest\report'
,
'--clean-alluredir'
])
...
...
test_case_data/bmc/bmc_testcase01_20210513.xlsx
View file @
cf8eb6f9
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