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
227bd1ab
Commit
227bd1ab
authored
Aug 23, 2021
by
taoke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
交委调试
parent
d0cdd35f
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
64 additions
and
3 deletions
+64
-3
common/tools.py
+0
-1
config.py
+1
-1
run.py
+1
-1
test_case/safe_transportation/conftest.py
+5
-0
test_case/safe_transportation/jgd/__init__.py
+2
-0
test_case/safe_transportation/jgd/test_riskManagement.py
+53
-0
test_case/safe_transportation/qyd/__init__.py
+2
-0
No files found.
common/tools.py
View file @
227bd1ab
...
...
@@ -75,7 +75,6 @@ def build_headers(headers, has_token):
headers
[
'Authorization'
]
=
SafeTransportationConfig
.
bmy_token
return
headers
def
get_case_dir
(
product_name
):
"""根据传入的产品名来运行对应产品的测试用例目录"""
test_case_dir
=
BaseConfig
.
test_case_dir
...
...
config.py
View file @
227bd1ab
...
...
@@ -169,4 +169,4 @@ class SafeTransportationConfig(BaseConfig):
sso_salt
=
'hikcreate_xj'
# SSO盐值
sso_token
=
''
sso_headers
=
{
'Content-Type'
:
'application/json'
,
'token'
:
sso_token
}
"appCode"
:
"1422744796822036481"
}
# 应用code
run.py
View file @
227bd1ab
...
...
@@ -29,7 +29,7 @@ if __name__ == "__main__":
os
.
system
(
'allure serve ./report/tmp'
)
# 发送钉钉
send_dingding
(
args
.
product
)
#
send_dingding(args.product)
test_case/safe_transportation/conftest.py
View file @
227bd1ab
...
...
@@ -12,9 +12,13 @@ def transport_bmy_login():
res
=
BMY
()
.
bmy_login
(
SafeTransportationConfig
.
test_name_password
)
setattr
(
SafeTransportationConfig
,
'bmy_token'
,
res
)
@pytest.fixture
(
scope
=
'module'
,
autouse
=
True
)
def
transport_sso_login
():
"""监管端登录获取token"""
token
=
Transport_ssoLogin
()
.
new_sso_login
({
"loginName"
:
"taoker"
,
"password"
:
"tk123456"
},
getToken
=
True
)
setattr
(
SafeTransportationConfig
,
'sso_token'
,
token
)
# if __name__ == '__main__':
# transport_bmy_login()
\ No newline at end of file
test_case/safe_transportation/jgd/__init__.py
0 → 100644
View file @
227bd1ab
# autor: taoke
# time : 2021/8/23 13:43
test_case/safe_transportation/jgd/test_riskManagement.py
0 → 100644
View file @
227bd1ab
# autor: taoke
# time : 2021/8/23 13:46
from
config
import
*
import
requests
,
pytest
from
common.tools
import
request_main
class
TestRiskManagement
():
def
test_qyd
(
self
):
print
(
"测试"
)
"""直接拿token"""
# bmy_token=SafeTransportationConfig.bmy_token
# bmy_headers = {"Content-Type": "application/json",
# "Authorization": bmy_token,
# "appCode": "1422744796822036481"}
# res=requests.post("http://testyun.banmago.com/api/tbd/web/baseData/intoVehicle/list",
# json={"appCode":"1422744796822036481","pageNum":1,"pageSize":10,"useNaturePropertyIds":[]},
# headers=bmy_headers)
# print(res.json())
"""使用公共方法"""
# res=request_main("http://testyun.banmago.com/api/tbd/web/baseData/intoVehicle/list",
# "",
# "POST",
# {"appCode":"1422744796822036481","pageNum":1,"pageSize":10,"useNaturePropertyIds":[]})
# print(res)
def
test_jgd
(
self
):
print
(
"测试"
)
# """直接拿token"""
# sso_token=SafeTransportationConfig.sso_token
# headers = {"Content-Type": "application/json",
# "token": sso_token}
# res=requests.post("http://testtbdzj.hikcreate.com/web/warnPoint/pageList",
# json={"pageNum":1,"pageSize":10},
# headers=headers)
# print(res.json())
"""使用公共方法"""
res
=
request_main
(
"http://testtbdzj.hikcreate.com/web/warnPoint/pageList"
,
""
,
"POST"
,
{
"pageNum"
:
1
,
"pageSize"
:
10
})
print
(
res
)
if
__name__
==
'__main__'
:
for
one
in
os
.
listdir
(
'../../../report/tmp'
):
if
'json'
or
'txt'
in
one
:
os
.
remove
(
f
'../../../report/tmp/{one}'
)
pytest
.
main
([
'test_riskManagement.py'
,
'-s'
,
'--alluredir'
,
'../../../report/tmp'
])
# 启动默认浏览器打开报告
# os.system('allure serve ../../../report/tmp')
\ No newline at end of file
test_case/safe_transportation/qyd/__init__.py
0 → 100644
View file @
227bd1ab
# autor: taoke
# time : 2021/8/23 13:43
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