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
b27b9a47
Commit
b27b9a47
authored
May 08, 2021
by
fanxun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加SSOConfig类
parent
fc850bc5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
13 deletions
+12
-13
config.py
+7
-8
test_case/sso/conftest.py
+5
-5
No files found.
config.py
View file @
b27b9a47
...
@@ -16,14 +16,6 @@ class BaseConfig():
...
@@ -16,14 +16,6 @@ class BaseConfig():
# 钉钉相关
# 钉钉相关
webhook
=
''
webhook
=
''
# SSO相关
sso_username
=
'robot_fanxun'
# SSO登录名
sso_password
=
'fx123456'
# sso密码
sso_url
=
r'http://testtbdzj.hikcreate.com/web/auth/users/login'
# sso登录地址
sso_salt
=
'hikcreate_xj'
# SSO盐值
sso_token
=
''
class
BMCConfig
(
BaseConfig
):
class
BMCConfig
(
BaseConfig
):
"""斑马信用app的配置类"""
"""斑马信用app的配置类"""
...
@@ -73,3 +65,10 @@ class BmyConfig(BaseConfig):
...
@@ -73,3 +65,10 @@ class BmyConfig(BaseConfig):
bmy_token
=
''
bmy_token
=
''
class
SSOConfig
(
BaseConfig
):
"""SSO配置类"""
sso_username
=
'robot_fanxun'
# SSO登录名
sso_password
=
'fx123456'
# sso密码
sso_url
=
r'http://testtbdzj.hikcreate.com/web/auth/users/login'
# sso登录地址
sso_salt
=
'hikcreate_xj'
# SSO盐值
sso_token
=
''
test_case/sso/conftest.py
View file @
b27b9a47
__author__
=
'fanxun'
__author__
=
'fanxun'
__data__
=
"2021-05-08 10:26"
__data__
=
"2021-05-08 10:26"
import
pytest
import
pytest
from
config
import
Base
Config
from
config
import
SSO
Config
from
common.utils.encryption
import
Encryption
from
common.utils.encryption
import
Encryption
from
common.tools
import
request_main
from
common.tools
import
request_main
@pytest.fixture
(
scope
=
'module'
,
autouse
=
True
)
@pytest.fixture
(
scope
=
'module'
,
autouse
=
True
)
def
sso_login
():
def
sso_login
():
"""SSO登录获取token"""
"""SSO登录获取token"""
encrypted_password
=
Encryption
()
.
get_md5
(
BaseConfig
.
sso_password
,
salt
=
Base
Config
.
sso_salt
)
encrypted_password
=
Encryption
()
.
get_md5
(
SSOConfig
.
sso_password
,
salt
=
SSO
Config
.
sso_salt
)
req_data
=
{
"loginName"
:
Base
Config
.
sso_username
,
"password"
:
encrypted_password
}
req_data
=
{
"loginName"
:
SSO
Config
.
sso_username
,
"password"
:
encrypted_password
}
res
=
request_main
(
Base
Config
.
sso_url
,
headers
=
None
,
method
=
'post'
,
data
=
req_data
)
res
=
request_main
(
SSO
Config
.
sso_url
,
headers
=
None
,
method
=
'post'
,
data
=
req_data
)
setattr
(
Base
Config
,
'sso_token'
,
res
[
'data'
][
'token'
])
setattr
(
SSO
Config
,
'sso_token'
,
res
[
'data'
][
'token'
])
...
...
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