Commit e60b035a authored by edz's avatar edz

om登录

parent 43eb1e73
...@@ -65,8 +65,15 @@ class achelous_request(BaseRequest): ...@@ -65,8 +65,15 @@ class achelous_request(BaseRequest):
self.params["unit"] = unit self.params["unit"] = unit
return self.api_send(self.data["unit_update"]) return self.api_send(self.data["unit_update"])
#om后台-登录
def account_login(self,username,password):
self.params["username"] = username
self.params["password"] = password
return self.api_send(self.data["account_login"])
if __name__ == "__main__": if __name__ == "__main__":
# print(achelous_request().batch_add_service("4176", "73809,23508,33823")) # print(achelous_request().batch_add_service("4176", "73809,23508,33823"))
# print(achelous_request().batch_del_service("4176","7312,7311")) # print(achelous_request().batch_del_service("4176","7312,7311"))
# print(achelous_request().special_edit("32244157","自定义专题创建1","0","2021-08-01 00:00:00","2021-09-30 00:00:00","1","自定义专题创建1","自定义专题创建1","https://heras.igengmei.com/4d5eef0a-78dd-43b3-98b7-137d2341f106-1628565831259")) # print(achelous_request().special_edit("32244157","自定义专题创建1","0","2021-08-01 00:00:00","2021-09-30 00:00:00","1","自定义专题创建1","自定义专题创建1","https://heras.igengmei.com/4d5eef0a-78dd-43b3-98b7-137d2341f106-1628565831259"))
print(achelous_request().special_list('1', '10', '', '', '', '', '', '1', '0', '', '')) print(achelous_request().special_list('1', '10', '', '', '', '', '', '1', '0', '', ''))
\ No newline at end of file print(achelous_request().account_login('chenrenkai','123456'))
\ No newline at end of file
...@@ -89,4 +89,14 @@ unit_update: ...@@ -89,4 +89,14 @@ unit_update:
order: ${order} order: ${order}
unit: ${unit} unit: ${unit}
json: {} json: {}
isLogin: 1 isLogin: 1
\ No newline at end of file
#om后台-登录
account_login:
method: post
url: /achelous/account/login
params: {}
data:
username: ${username}
password: ${password}
json: {}
\ No newline at end of file
...@@ -612,6 +612,8 @@ CHECK_SPU_IDS = os.path.join(BASE_DIR, "backend_auto/test_om_data/beautycard_dat ...@@ -612,6 +612,8 @@ CHECK_SPU_IDS = os.path.join(BASE_DIR, "backend_auto/test_om_data/beautycard_dat
ACHELOUS_REQUEST_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_om_api", "achelous_request.yaml") ACHELOUS_REQUEST_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_om_api", "achelous_request.yaml")
#直播-om后台-批量添加美购 #直播-om后台-批量添加美购
BATCH_ADD_SERVICE = os.path.join(BASE_DIR, "backend_auto/test_om_data/achelous_data", "batch_add_service.yaml") BATCH_ADD_SERVICE = os.path.join(BASE_DIR, "backend_auto/test_om_data/achelous_data", "batch_add_service.yaml")
#登录
ACCOUNT_DATA = os.path.join(BASE_DIR, "backend_auto/test_om_data/achelous_data", "account_login.yaml")
#次卡商详页 #次卡商详页
BEAUTY_CARD_DETAIL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "beauty_card_detail.yaml") BEAUTY_CARD_DETAIL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "beauty_card_detail.yaml")
......
import pytest
import path_setting
from all_om_api.achelous_request import achelous_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
class TestAccountLogin:
data = BaseRequest().api_load(path_setting.ACCOUNT_DATA)
account_login_case, account_login_data = get_ids(data, "account_login")
@pytest.mark.parametrize("param",account_login_data,ids=account_login_case)
def test_batch_add_service(self,param):
r = achelous_request().account_login(param['username'],param['password'])
if r["code"] == 0:
assert r['msg'] == param["assert"]
elif r["code"] == 20001:
assert r['msg'] == param["assert"]
elif r["code"] == 20005:
assert r['msg'] == param["assert"]
else:
assert r['error'] == param["assert"]
account_login:
-
case: "om后台登录"
username: "chenrenkai"
password: "123456"
assert: "success!"
-
case: "登录失败-账号密码错误"
username: "chenrenkaizidonghua"
password: "dng6Rq1"
assert: "账号或密码输入错误,请核对后重新输入!"
-
case: "第二次登录失败"
username: "chenrenkaizidonghua"
password: "dng6Rq1"
assert: "账号或密码输入错误,请核对后重新输入!"
-
case: "第三次登录失败"
username: "chenrenkaizidonghua"
password: "dng6Rq1"
assert: "账号或密码输入错误,请核对后重新输入!"
-
case: "第四次登录失败"
username: "chenrenkaizidonghua"
password: "dng6Rq1"
assert: "账号或密码输入错误,请核对后重新输入!"
-
case: "第五次登录失败"
username: "chenrenkaizidonghua"
password: "dng6Rq1"
assert: "账号或密码输入错误,请核对后重新输入!"
-
case: "第六次登录失败"
username: "chenrenkaizidonghua"
password: "dng6Rq1"
assert: "账号或密码输入错误,请核对后重新输入!"
-
case: "第七次登录失败"
username: "chenrenkaizidonghua"
password: "dng6Rq1"
assert: "账号或密码输入错误,请核对后重新输入!"
-
case: "第八次登录失败"
username: "chenrenkaizidonghua"
password: "dng6Rq1"
assert: "账号或密码输入错误,请核对后重新输入!"
-
case: "第九次登录失败"
username: "chenrenkaizidonghua"
password: "dng6Rq1"
assert: "账号或密码输入错误,请核对后重新输入!"
-
case: "第十次登录失败"
username: "chenrenkaizidonghua"
password: "dng6Rq1"
assert: "账号或密码输入错误,请核对后重新输入!"
-
case: "第十一次登录失败"
username: "chenrenkaizidonghua"
password: "dng6Rq1"
assert: "账号或密码输入错误,请核对后重新输入!"
-
case: "第12次登录失败"
username: "chenrenkaizidonghua"
password: "dng6Rq1"
assert: "账号或密码输入错误,请核对后重新输入!"
-
case: "第13次登录失败"
username: "chenrenkaizidonghua"
password: "dng6Rq1"
assert: "账号或密码输入错误,请核对后重新输入!"
-
case: "第14次登录失败"
username: "chenrenkaizidonghua"
password: "dng6Rq1"
assert: "账号或密码输入错误,请核对后重新输入!"
-
case: "第15次登录失败"
username: "chenrenkaizidonghua"
password: "dng6Rq1"
assert: "账号或密码输入错误,请核对后重新输入!"
-
case: "第16次登录失败"
username: "chenrenkaizidonghua"
password: "dng6Rq1"
assert: "账号或密码输入错误,请核对后重新输入!"
-
case: "第17次登录失败"
username: "chenrenkaizidonghua"
password: "dng6Rq1"
assert: "账号或密码输入错误,请核对后重新输入!"
-
case: "第18次登录失败"
username: "chenrenkaizidonghua"
password: "dng6Rq1"
assert: "账号或密码输入错误,请核对后重新输入!"
-
case: "第19次登录失败"
username: "chenrenkaizidonghua"
password: "dng6Rq1"
assert: "账号或密码输入错误,请核对后重新输入!"
-
case: "第20次登录失败"
username: "chenrenkaizidonghua"
password: "dng6Rq1"
assert: "账号或密码输入错误,请核对后重新输入!"
-
case: "登录超限账号锁定"
username: "chenrenkaizidonghua"
password: "dng6Rq1"
assert: "尝试次数超过20次,您的帐号被锁定1小时,请1小时后重新登录"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment