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
a9b5d8db
Commit
a9b5d8db
authored
Jun 17, 2020
by
文鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test2
parent
ea633afe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
0 deletions
+61
-0
test_System.py
+61
-0
No files found.
test_System.py
0 → 100644
View file @
a9b5d8db
# _*_ coding:utf-8 _*_
_author_
=
'wenxin'
_date_
=
'2020/6/11 11:03'
import
requests
import
allure
import
pytest
from
common
import
getHeader
from
common.getData
import
DoExcelByPandas
@allure.feature
(
'系统设置'
)
class
TestSystem
():
parametrize
=
DoExcelByPandas
()
.
get_data_for_pytest
(
'./data/data.xlsx'
,
'Sheet1'
)
@pytest.mark.parametrize
(
'id,url,data,story,severity,condition,except_result'
,
parametrize
)
def
test
(
self
,
id
,
url
,
data
,
story
,
severity
,
condition
,
except_result
):
# test开头的测试函数
headers
=
getHeader
.
get_Header
()
url
=
url
json
=
eval
(
data
)
r
=
requests
.
post
(
url
=
url
,
json
=
json
,
headers
=
headers
)
response
=
r
.
json
()
assert
response
[
condition
]
==
except_result
# 断言成功
# @allure.story('获取用户列表')
# @allure.severity('critical')
# def test_getUser(self):
# headers = getHeader.get_Header()
# url = config.url + '/web/user/queryUserPages'
# json = {"pageNum":1,"pageSize":10,"deptCode":"650000000000"}
# r = requests.post(url=url, json=json,headers = headers)
# assert ( r.json()['result']['list'][0]['userCode']) == '000000'
#
# @allure.story('获取角色列表')
# @allure.severity('critical')
# def test_getRole(self):
# headers = getHeader.get_Header()
# url = config.url + '/web/role/queryRolePageByCurUser'
# json = {"pageNum":1,"pageSize":10}
# r = requests.post(url=url, json=json,headers = headers)
# assert r.json()['result']['list'][0]['roleCode'] == '001002'
#
# @allure.story('获取部门列表')
# @allure.severity('critical')
# def test_getDepartment(self):
# headers = getHeader.get_Header()
# url = config.url + '/web/dept/queryByDeptCode'
# json = {"deptCode":"650000000000"}
# r = requests.post(url=url, json=json, headers=headers)
# assert r.json()['result']['deptCode'] == '650000000000'
#
# @allure.story('获取意见反馈列表')
# @allure.severity('critical')
# def test_getFeedback(self):
# headers = getHeader.get_Header()
# url = config.url + '/web/feedback/list'
# json = {"pageSize":10,"pageNum":1,"total":0,"pages":0,"userName":"","deptCode":""}
# r = requests.post(url=url,json=json,headers=headers)
# assert r.json()['result']['list'][0]['userCode'] == '999999'
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