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
ad6e1ae0
Commit
ad6e1ae0
authored
May 15, 2021
by
taoke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
屏蔽信用分和积分商城
parent
c6a74f2b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
38 deletions
+36
-38
service/environment.properties
+0
-2
test_case/bmc/test_credit_score.py
+19
-19
test_case/bmc/test_integral.py
+17
-17
No files found.
service/environment.properties
deleted
100644 → 0
View file @
c6a74f2b
Python.Version
=
3.7
\ No newline at end of file
test_case/bmc/test_credit_score.py
View file @
ad6e1ae0
...
@@ -8,25 +8,25 @@ from common.tools import request_main
...
@@ -8,25 +8,25 @@ 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.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 )
#
#res = requests.post(url = url,headers =headers,json =req_data )
res
=
request_main
(
url
=
url
,
headers
=
headers
,
method
=
method
,
data
=
req_data
,
has_token
=
True
)
#
res = request_main(url=url, headers=headers, method=method, data=req_data, has_token=True)
print
(
config
.
BMCConfig
.
headers
)
#
print(config.BMCConfig.headers)
assert
res
[
'code'
]
==
expectData
[
'code'
]
#
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'
,
...
...
test_case/bmc/test_integral.py
View file @
ad6e1ae0
...
@@ -8,23 +8,23 @@ from common.tools import request_main
...
@@ -8,23 +8,23 @@ 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.title("{inData[testPoint]}")
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
'积分商城'
,
'Integral'
))
#
@pytest.mark.parametrize("inData", get_excelData(workBook, '积分商城', 'Integral'))
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 )
#
#res = requests.post(url = url,headers =headers,json =req_data )
res
=
request_main
(
url
=
url
,
headers
=
headers
,
method
=
method
,
data
=
req_data
,
has_token
=
True
)
#
res = request_main(url=url, headers=headers, method=method, data=req_data, has_token=True)
print
(
res
)
#
print(res)
assert
res
[
'code'
]
==
expectData
[
'code'
]
#
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'
,
...
...
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