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
5a922638
Commit
5a922638
authored
May 08, 2021
by
fanxun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch 'master' of D:\项目\接口自动化\InterfaceAutoTest with conflicts.
parent
cb7c4838
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
27 deletions
+11
-27
config.py
+4
-2
service/login.py
+4
-25
test_case/sso/__init__.py
+3
-0
No files found.
config.py
View file @
5a922638
...
...
@@ -17,10 +17,12 @@ class BaseConfig():
webhook
=
''
# SSO相关
username
=
'
fanxun'
# SSO登录名
password
=
'fx123456'
# sso密码
sso_username
=
'robot_
fanxun'
# SSO登录名
sso_
password
=
'fx123456'
# sso密码
sso_url
=
r'http://testtbdzj.hikcreate.com/web/auth/users/login'
# sso登录地址
salt
=
'hikcreate_xj'
# SSO盐值
sso_token
=
''
class
BMCConfig
(
BaseConfig
):
...
...
service/login.py
View file @
5a922638
...
...
@@ -9,22 +9,6 @@ from common.db import RedisString
from
config
import
BmyConfig
# @pytest.fixture(scope='session')
class
SSOLogin
():
"""SSO登录"""
def
_sso_pwd_encrypted
(
self
,
org_pwd
):
"""md5加密"""
encrypted_password
=
Encryption
()
.
get_md5
(
org_pwd
,
salt
=
BaseConfig
.
salt
)
return
encrypted_password
def
sso_login
(
self
,
url
,
method
,
headers
=
None
):
"""SSO登录获取token"""
encrypted_password
=
self
.
_sso_pwd_encrypted
(
BaseConfig
.
password
)
req_data
=
{
f
"loginName"
:
BaseConfig
.
username
,
"password"
:
encrypted_password
}
res
=
request_main
(
url
,
headers
,
method
,
req_data
)
return
res
[
'data'
][
'token'
]
class
BMY
():
"""斑马云登录相关"""
# 获取当前时间的Authorization
...
...
@@ -113,12 +97,7 @@ class BMY():
if
__name__
==
'__main__'
:
# # SSO登录测试
# sso_token = SSOLogin().sso_login(url=BaseConfig.sso_url,
# method='post',)
# print(sso_token)
# BMY登录
indata
=
BmyConfig
.
test_name_password
token
=
BMY
()
.
bmy_login
(
indata
,
getToken
=
False
)
print
(
token
)
# indata= {"username":"15150000000","password":"A123456"}
# token= BMY().bmy_login(indata,getToken=False)
# print(token)
pass
test_case/sso/__init__.py
0 → 100644
View file @
5a922638
__author__
=
'fanxun'
__data__
=
"2021-05-08 11:08"
\ 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