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
8854819d
Commit
8854819d
authored
May 09, 2021
by
jiaqiying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
config headers sso
parent
07b75db5
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
5 deletions
+9
-5
common/tools.py
+6
-3
config.py
+1
-0
run.py
+2
-2
No files found.
common/tools.py
View file @
8854819d
...
@@ -38,16 +38,18 @@ def get_headers():
...
@@ -38,16 +38,18 @@ def get_headers():
headers
=
BMCConfig
.
headers
headers
=
BMCConfig
.
headers
elif
name
==
BmyConfig
.
name
:
elif
name
==
BmyConfig
.
name
:
headers
=
BmyConfig
.
headers
headers
=
BmyConfig
.
headers
# elif name == Sso
Config.name:
elif
name
==
SSO
Config
.
name
:
# headers = Sso
Config.headers
headers
=
SSO
Config
.
headers
return
headers
return
headers
def
get_case_dir
(
product_name
):
def
get_case_dir
(
product_name
):
"""根据传入的产品名来运行对应产品的测试用例目录"""
"""根据传入的产品名来运行对应产品的测试用例目录"""
test_case_dir
=
BaseConfig
.
name
test_case_dir
=
BaseConfig
.
test_case_dir
if
product_name
==
BMCConfig
.
name
:
if
product_name
==
BMCConfig
.
name
:
test_case_dir
=
BMCConfig
.
test_case_dir
test_case_dir
=
BMCConfig
.
test_case_dir
if
product_name
==
BmyConfig
.
name
:
if
product_name
==
BmyConfig
.
name
:
test_case_dir
=
BmyConfig
.
test_case_dir
test_case_dir
=
BmyConfig
.
test_case_dir
if
product_name
==
SSOConfig
.
name
:
test_case_dir
=
SSOConfig
.
test_case_dir
return
test_case_dir
return
test_case_dir
\ No newline at end of file
config.py
View file @
8854819d
...
@@ -67,6 +67,7 @@ class BmyConfig(BaseConfig):
...
@@ -67,6 +67,7 @@ class BmyConfig(BaseConfig):
class
SSOConfig
(
BaseConfig
):
class
SSOConfig
(
BaseConfig
):
"""SSO配置类"""
"""SSO配置类"""
name
=
"sso"
sso_username
=
'robot_fanxun'
# SSO登录名
sso_username
=
'robot_fanxun'
# SSO登录名
sso_password
=
'fx123456'
# sso密码
sso_password
=
'fx123456'
# sso密码
sso_url
=
r'http://testtbdzj.hikcreate.com/web/auth/users/login'
# sso登录地址
sso_url
=
r'http://testtbdzj.hikcreate.com/web/auth/users/login'
# sso登录地址
...
...
run.py
View file @
8854819d
...
@@ -8,14 +8,14 @@ from common.tools import get_case_dir
...
@@ -8,14 +8,14 @@ from common.tools import get_case_dir
def
get_parser
():
def
get_parser
():
parser
=
argparse
.
ArgumentParser
(
description
=
"argparse"
)
parser
=
argparse
.
ArgumentParser
(
description
=
"argparse"
)
parser
.
add_argument
(
'--product'
,
type
=
str
,
default
=
BaseConfig
.
name
)
parser
.
add_argument
(
'--product'
,
type
=
str
,
default
=
BaseConfig
.
current_
name
)
return
parser
return
parser
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
parser
=
get_parser
()
parser
=
get_parser
()
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
BaseConfig
.
name
=
args
.
product
BaseConfig
.
current_
name
=
args
.
product
# 获取要执行的产品的用例目录
# 获取要执行的产品的用例目录
test_case_dir
=
get_case_dir
(
args
.
product
)
test_case_dir
=
get_case_dir
(
args
.
product
)
print
(
"********此次执行的产品测试用例是:
%
s********"
%
test_case_dir
)
print
(
"********此次执行的产品测试用例是:
%
s********"
%
test_case_dir
)
...
...
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