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
d2ff6208
Commit
d2ff6208
authored
Jul 01, 2020
by
文鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改data
parent
bd60a0d0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
data/data.xlsx
+0
-0
test_System.py
+9
-9
No files found.
data/data.xlsx
View file @
d2ff6208
No preview for this file type
test_System.py
View file @
d2ff6208
...
...
@@ -11,20 +11,20 @@ from common.getData import DoExcelByPandas
class
TestSystem
():
parametrize
=
DoExcelByPandas
()
.
get_data_for_pytest
(
'./data/data.xlsx'
,
'Sheet1'
)
# data = DoExcelByPandas.get_data_for_allure('./data/data.xlsx','Sheet1')
def
setup_class
(
self
):
print
(
"setup_function:在用例执行前执行"
)
#
def setup_class(self):
#
print("setup_function:在用例执行前执行")
def
teardown_class
(
self
):
print
(
"teardown_function:在用例执行后执行"
)
#
def teardown_class(self):
#
print("teardown_function:在用例执行后执行")
@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开头的测试函数
print
(
'正在执行'
,
story
)
headers
=
getHeader
.
get_Header
()
url
=
url
json
=
eval
(
data
)
# print('正在执行',story)
# headers = getHeader.get_Header()
url
=
url
if
method
==
'post'
:
r
=
requests
.
post
(
url
=
url
,
json
=
json
,
headers
=
headers
)
json
=
eval
(
data
)
r
=
requests
.
post
(
url
=
url
,
json
=
json
)
else
:
r
=
requests
.
get
(
url
=
url
)
response
=
r
.
json
()
...
...
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