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
26af2668
Commit
26af2668
authored
May 08, 2021
by
fanxun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SSO登录添加conftest
parent
1dd28fd4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
test_case/sso/conftest.py
+19
-0
No files found.
test_case/sso/conftest.py
0 → 100644
View file @
26af2668
__author__
=
'fanxun'
__data__
=
"2021-05-08 10:26"
import
pytest
from
config
import
BaseConfig
from
common.utils.encryption
import
Encryption
from
common.tools
import
request_main
@pytest.fixture
(
scope
=
'module'
,
autouse
=
True
)
def
sso_login
():
"""SSO登录获取token"""
encrypted_password
=
Encryption
()
.
get_md5
(
BaseConfig
.
sso_password
,
salt
=
BaseConfig
.
salt
)
req_data
=
{
"loginName"
:
BaseConfig
.
sso_username
,
"password"
:
encrypted_password
}
res
=
request_main
(
BaseConfig
.
sso_url
,
headers
=
None
,
method
=
'post'
,
data
=
req_data
)
setattr
(
BaseConfig
,
BaseConfig
.
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