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
026c7355
Commit
026c7355
authored
May 06, 2021
by
fanxun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SSO登录初步调试
parent
13cae9ed
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
17 deletions
+30
-17
config.py
+5
-13
service/login.py
+25
-4
No files found.
config.py
View file @
026c7355
...
...
@@ -3,21 +3,13 @@
class
BaseConfig
():
"""基础配置类"""
# 请求头
headers
=
{
'Content-Type'
:
'application/json
; charset=utf-8
'
}
headers
=
{
'Content-Type'
:
'application/json'
}
# 当前运行的产品名
current_product
=
""
webhook
=
''
salt
=
'hikcreate_xj'
class
BMCConfig
(
BaseConfig
):
"""斑马信用app的配置类"""
pass
class
DingTalk
(
BaseConfig
):
"""钉钉机器人"""
webhook
=
''
class
SSOLoginConfig
(
BaseConfig
):
"""登录配置"""
salt
=
'hikcreate_xj'
\ No newline at end of file
pass
\ No newline at end of file
service/login.py
View file @
026c7355
import
pytest
import
requests
from
config
import
BaseConfig
from
common.utils.encryption
import
Encryption
# from common.utils.getExcelData import get_excelData
from
common.tools
import
request_main
@pytest.fixture
(
scope
=
'session'
)
def
sso_login
(
url
,
headers
,
method
,
data
):
"""SSO登录"""
req_data
=
{
"loginName"
:
"fanxun"
,
"password"
:
"fx123456"
}
password
=
req_data
[
'password'
]
md5_password
=
Encryption
()
.
get_md5
(
password
,
salt
=
BaseConfig
.
salt
)
req_data
[
'password'
]
=
md5_password
res
=
request_main
(
url
,
headers
,
method
,
req_data
)
print
(
res
)
def
sso_login
():
"""sso登录"""
pass
def
bmy_login
():
...
...
@@ -11,4 +24,12 @@ def bmy_login():
pass
if
__name__
==
'__main__'
:
# login = request_main(url=r'http://testtbdzj.hikcreate.com/web/auth/users/login',
# method='post',
# data={"loginName":"fanxun","password":"d67fac1d71943576b6c397d0cca166cb"},
# headers=getattr(BaseConfig, 'headers'))
sso_login
(
r'http://testtbdzj.hikcreate.com/web/auth/users/login'
,
headers
=
getattr
(
BaseConfig
,
'headers'
),
method
=
'post'
,
data
=
None
)
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