Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
API-Automation
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
文鑫
API-Automation
Commits
19b8f911
Commit
19b8f911
authored
Jun 19, 2020
by
文鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加title
parent
d7915055
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletions
+6
-1
test_System.py
+6
-1
No files found.
test_System.py
View file @
19b8f911
...
...
@@ -10,6 +10,8 @@ from common.getData import DoExcelByPandas
@allure.feature
(
'系统设置'
)
class
TestSystem
():
parametrize
=
DoExcelByPandas
()
.
get_data_for_pytest
(
'./data/data.xlsx'
,
'Sheet1'
)
# data = DoExcelByPandas.get_data_for_allure('./data/data.xlsx','Sheet1')
@allure.title
(
'{story}'
)
@pytest.mark.parametrize
(
'id,url,data,story,method,severity,condition,except_result'
,
parametrize
)
def
test
(
self
,
id
,
url
,
data
,
story
,
method
,
severity
,
condition
,
except_result
):
# test开头的测试函数
headers
=
getHeader
.
get_Header
()
...
...
@@ -17,8 +19,11 @@ class TestSystem():
json
=
eval
(
data
)
if
method
==
'post'
:
r
=
requests
.
post
(
url
=
url
,
json
=
json
,
headers
=
headers
)
else
:
r
=
requests
.
get
(
url
=
url
)
response
=
r
.
json
()
assert
response
[
condition
]
==
except_result
# 断言成功
# print (type(response[condition]))
assert
response
[
condition
]
==
str
(
except_result
)
...
...
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