Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
backend_auto
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
邓莹莹
backend_auto
Commits
47902d22
Commit
47902d22
authored
Jun 11, 2021
by
aha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
om后台登陆
parent
2ded200d
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
122 additions
and
0 deletions
+122
-0
login_request.py
all_om_api/login_request.py
+19
-0
login_request.yaml
all_om_api/login_request.yaml
+9
-0
path_setting.py
path_setting.py
+5
-0
__init__.py
test_om_case/om_login_case/__init__.py
+0
-0
test_om_login.py
test_om_case/om_login_case/test_om_login.py
+22
-0
__init__.py
test_om_data/om_login_data/__init__.py
+0
-0
om_login.yaml
test_om_data/om_login_data/om_login.yaml
+67
-0
No files found.
all_om_api/login_request.py
View file @
47902d22
import
path_setting
from
in_common.base_request
import
BaseRequest
class
login_request
(
BaseRequest
):
def
__init__
(
self
):
#om后台-登录
self
.
data
=
self
.
api_load
(
path_setting
.
OMLOGIN_CONFIG
)
#om后台-登录
def
om_login
(
self
,
username
,
password
,
Cookie
=
'session_key=b3owiduporwyatpueme46orsofkfgwjv'
):
self
.
params
[
"username"
]
=
username
self
.
params
[
"password"
]
=
password
return
self
.
api_send
(
self
.
data
[
"om_login"
])
if
__name__
==
'__main__'
:
print
(
login_request
()
.
om_login
(
"admin"
,
"123123"
))
\ No newline at end of file
all_om_api/login_request.yaml
0 → 100644
View file @
47902d22
#om后台-登录
om_login
:
method
:
POST
url
:
/achelous/account/login
params
:
{}
data
:
username
:
${username}
password
:
${password}
json
:
{}
path_setting.py
View file @
47902d22
...
@@ -376,5 +376,10 @@ ALIPAYDATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/pay_data", "
...
@@ -376,5 +376,10 @@ ALIPAYDATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/pay_data", "
JUMPDATA
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/pay_data"
,
"jump.yaml"
)
JUMPDATA
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/pay_data"
,
"jump.yaml"
)
SETTLEMENTDELETE
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/settlement_data"
,
"settlement_delete.yaml"
)
SETTLEMENTDELETE
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/settlement_data"
,
"settlement_delete.yaml"
)
#OM后台-登录
OMLOGIN_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_om_api"
,
"login_request.yaml"
)
OMLOGIN
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_om_data/om_login_data"
,
"om_login.yaml"
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
print
(
"=========="
,
LIVEYAML_CONFIG
)
print
(
"=========="
,
LIVEYAML_CONFIG
)
test_om_case/om_login_case/__init__.py
0 → 100644
View file @
47902d22
test_om_case/om_login_case/test_om_login.py
0 → 100644
View file @
47902d22
import
pytest
import
path_setting
from
all_om_api.login_request
import
login_request
from
ids_list
import
get_ids
from
in_common.base_request
import
BaseRequest
#om后台-登录
class
TestOmLogin
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
OMLOGIN
)
om_login_case
,
om_login_data
=
get_ids
(
data
,
"om_login"
)
@pytest.mark.parametrize
(
"param"
,
om_login_data
,
ids
=
om_login_case
)
def
test_om_login
(
self
,
param
):
r
=
login_request
()
.
om_login
(
param
[
"username"
],
param
[
"password"
])
if
r
[
"code"
]
==
0
:
print
(
"om后台成功登陆"
)
assert
r
[
"msg"
]
==
param
[
"assert"
]
if
r
[
"code"
]
!=
0
:
print
(
"om后台登陆出错"
)
assert
r
[
"msg"
]
==
param
[
"assert"
]
\ No newline at end of file
test_om_data/om_login_data/__init__.py
0 → 100644
View file @
47902d22
test_om_data/om_login_data/om_login.yaml
0 → 100644
View file @
47902d22
om_login
:
#om后台-登录-输入正确的用户名和正确的密码
-
case
:
"
om后台-登录-输入正确的用户名和密码"
username
:
"
admin"
password
:
"
123123"
assert
:
success!
#om后台-登录-输入正确的用户名和错误的密码
-
case
:
"
om后台-登录-输入正确的用户名和错误的密码"
username
:
"
admin"
password
:
"
1231234"
assert
:
Login failed!
#om后台-登录-输入正确的用户名和不输入密码
-
case
:
"
om后台-登录-输入正确的用户名和不输入密码"
username
:
"
admin"
password
:
"
"
assert
:
Login failed!
#om后台-登录-输入正确的用户名和无效密码
-
case
:
"
om后台-登录-输入正确的用户名和无效密码"
username
:
"
admin"
password
:
"
哈哈"
assert
:
Login failed!
#om后台-登录-输入错误的用户名和正确的密码
-
case
:
"
om后台-登录-输入错误的用户名和正确的密码"
username
:
"
admin1"
password
:
"
123123"
assert
:
Login failed!
#om后台-登录-不输入用户名和输入正确的密码
-
case
:
"
om后台-登录-不输入用户名和输入正确的密码"
username
:
"
"
password
:
"
123123"
assert
:
Login failed!
#om后台-登录-输入无效用户名和正确的密码
-
case
:
"
om后台-登录-输入无效用户名和正确的密码"
username
:
"
哈哈"
password
:
"
123123"
assert
:
Login failed!
#om后台-登录-输入错误的用户名和输入错误的密码
-
case
:
"
om后台-登录-输入错误的用户名和输入错误的密码"
username
:
"
admin1"
password
:
"
1231234"
assert
:
Login failed!
#om后台-登录-不输入用户名和密码
-
case
:
"
om后台-登录-不输入用户名和密码"
username
:
"
"
password
:
"
"
assert
:
Login failed!
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