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
eb3dd3b5
Commit
eb3dd3b5
authored
Aug 23, 2021
by
hanxiaojuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
交委项目新增全息档案用例
parent
c4111eee
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
2 deletions
+40
-2
config.py
+3
-2
test_case/safe_transportation/jgd/test_archives.py
+37
-0
No files found.
config.py
View file @
eb3dd3b5
...
...
@@ -160,12 +160,13 @@ class SafeTransportationConfig(BaseConfig):
test_host
=
"http://testyun.banmago.com/api"
test_name_password
=
{
"username"
:
"15150000000"
,
"password"
:
"A123456"
,
"Register-Origin"
:
"yun"
}
bmy_token
=
''
headers
=
{
"Content-Type"
:
"application/json"
,
"Authorization"
:
bmy_token
}
#
headers = {"Content-Type": "application/json",
#
"Authorization":bmy_token}
# sso
sso_username
=
'robot_fanxun'
# SSO登录名
sso_password
=
'fx123456'
# sso密码
sso_url
=
r'http://testtbdzj.hikcreate.com/web/auth/users/login'
# sso登录地址
SSO_url
=
r'http://testtbdzj.hikcreate.com/web'
#监管端sso
sso_salt
=
'hikcreate_xj'
# SSO盐值
sso_token
=
''
headers
=
{
'Content-Type'
:
'application/json'
,
...
...
test_case/safe_transportation/jgd/test_archives.py
0 → 100644
View file @
eb3dd3b5
import
pytest
,
allure
,
xlrd
,
requests
,
os
from
common.utils.getExcelData
import
get_excelData
from
service.login
import
BMY
from
common.tools
import
request_main
from
config
import
*
from
service.login
import
BMY
@allure.feature
(
"全息档案"
)
class
TestEnterpriseArchives
():
workBook
=
xlrd
.
open_workbook
(
f
'{BaseConfig.root_path}/test_case_data/safe_transportation/jgd_archives.xlsx'
)
@allure.story
(
"企业档案列表"
)
@allure.title
(
"{inData[testPoint]}"
)
@allure.testcase
(
"http://yapi.hikcreate.com/project/336/interface/api/69879"
)
@allure.description
(
"企业档案"
)
@pytest.mark.parametrize
(
"inData"
,
get_excelData
(
workBook
,
'全息档案'
,
'enterpriseArchives'
))
def
test_enterpriseArchives
(
self
,
inData
):
url
=
f
"{SafeTransportationConfig().SSO_url}{inData['url']}"
headers
=
inData
[
'headers'
]
method
=
inData
[
'method'
]
data
=
inData
[
'reqData'
]
expectData
=
inData
[
'expectData'
]
res
=
request_main
(
url
,
headers
,
method
,
data
)
allure
.
attach
(
f
"{res}"
,
"响应结果"
,
allure
.
attachment_type
.
TEXT
)
assert
res
[
'code'
]
==
expectData
[
'code'
]
if
__name__
==
'__main__'
:
for
one
in
os
.
listdir
(
'../../../report/tmp'
):
# 列出对应文件夹的数据
if
'json'
in
one
:
os
.
remove
(
f
'../../../report/tmp/{one}'
)
pytest
.
main
([
'test_archives.py'
,
'-s'
,
'--alluredir'
,
'../../../report/tmp'
])
# # 启动默认浏览器打开报告
os
.
system
(
'allure serve ../../../report/tmp'
)
\ No newline at end of file
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