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
112bc6fc
Commit
112bc6fc
authored
May 17, 2021
by
fanxun
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
cf8eb6f9
02b6c863
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
8 deletions
+7
-8
run.py
+2
-3
service/login.py
+4
-4
test_case/bmc/test_accountinfo.py
+1
-1
No files found.
run.py
View file @
112bc6fc
...
...
@@ -22,13 +22,12 @@ if __name__ == "__main__":
print
(
"********此次执行的产品测试用例是:
%
s********"
%
test_case_dir
)
#删除之前报告
for
one
in
os
.
listdir
(
'./report/tmp'
):
if
'json'
in
one
:
os
.
remove
(
f
'./report/tmp/{one}'
)
os
.
system
(
'rm ./report/tmp/*.json'
)
# 生成报告数据
pytest
.
main
([
'-v'
,
'-s'
,
test_case_dir
,
'--alluredir'
,
'./report/tmp'
])
# 打开报告
# os.system('allure serve ./report/tmp')
# 发送钉钉
dingTalk
.
dingTalk_markdown
(
secret
=
"SEC1d08f46da74337cc0e1cd5bb9ad19622d825483343fdfa43ce396881e4745bdb"
,
webhook
=
"https://oapi.dingtalk.com/robot/send?access_token=f9e005c1a984b9607960345d38669337b1115d1141a0294e98666443b312115b"
,
message
=
""
)
...
...
service/login.py
View file @
112bc6fc
...
...
@@ -99,16 +99,16 @@ class BMC():
"Device-Code"
:
"000000001e167ed7000000001e167ed7"
}
res
=
requests
.
post
(
url
,
json
=
indata
,
headers
=
header
)
print
(
res
.
json
())
#
print(res.json())
encrypted_token
=
Encryption
()
.
aes_token
(
res
.
json
()[
"data"
][
"token"
])
print
(
encrypted_token
)
#
print(encrypted_token)
# 获取专网token
header1
=
header
.
copy
()
header1
[
"Token"
]
=
encrypted_token
resp
=
requests
.
get
(
"http://testbmcapp.hikcreate.com/token"
,
headers
=
header1
)
print
(
resp
.
json
())
#
print(resp.json())
pvt_token
=
resp
.
json
()[
"data"
][
"token"
]
print
(
pvt_token
)
#
print(pvt_token)
return
encrypted_token
,
pvt_token
...
...
test_case/bmc/test_accountinfo.py
View file @
112bc6fc
...
...
@@ -32,7 +32,7 @@ class TestLogin():
headers
=
config
.
BMCConfig
.
loginheader
#res = requests.post(url = url,headers =headers,json =req_data )
res
=
request_main
(
url
=
url
,
headers
=
headers
,
method
=
method
,
data
=
req_data
,
has_token
=
True
)
print
(
res
)
#
print(res)
assert
res
[
'code'
]
==
expectData
[
'code'
]
if
__name__
==
'__main__'
:
pytest
.
main
([
'-s'
,
'-v'
,
'test_accountinfo.py'
,
...
...
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