Commit ea68defa authored by aha's avatar aha

OM后台自定义专题相关

parent 1a865cf0
......@@ -15,6 +15,58 @@ class achelous_request(BaseRequest):
# self.params["service_item_ids"] = service_item_ids
# return self.api_send(self.data["batch_add_service"])
#OM后台-自定义专题搜索
def special_list(self, page_index, page_capacity, page_id, name, creator_name, create_time_gt, create_time_lt, is_online, status, start_time, end_time):
self.params["page_index"] = page_index
self.params["page_capacity"] = page_capacity
self.params["page_id"] = page_id
self.params["name"] = name
self.params["creator_name"] = creator_name
self.params["create_time_gt"] = create_time_gt
self.params["create_time_lt"] = create_time_lt
self.params["is_online"] = is_online
self.params["status"] = status
self.params["start_time"] = start_time
self.params["end_time"] = end_time
return self.api_send(self.data["special_list"])
#OM后台-自定义专题创建
def special_edit(self, user_id, name, id, start_time, end_time, is_online, share_title, share_content, share_pic ):
self.params["user_id"] = user_id
self.params["name"] = name
self.params["id"] = id
self.params["start_time"] = start_time
self.params["end_time"] = end_time
self.params["is_online"] = is_online
self.params["share_title"] = share_title
self.params["share_content"] = share_content
self.params["share_pic"] = share_pic
return self.api_send(self.data["special_edit"])
#OM后台-自定义专题删除
def special_delete(self, ids ):
self.params["ids"] = ids
print('*'*100)
return self.api_send(self.data["special_delete"])
#OM后台-组件库创建保存/更新保存
def page_edit(self, visualpage_id, name, visual_info):
self.params["visualpage_id"] = visualpage_id
self.params["name"] = name
self.params["visual_info"] = visual_info
return self.api_send(self.data["page_edit"])
#OM后台-自定义专题组件创建保存/更新保存
def unit_update(self, page_id, order, unit):
self.params["page_id"] = page_id
self.params["order"] = order
self.params["unit"] = unit
return self.api_send(self.data["unit_update"])
if __name__ == "__main__":
print(achelous_request().batch_add_service("4176", "73809,23508,33823"))
# print(achelous_request().batch_del_service("4176","7312,7311"))
\ No newline at end of file
# print(achelous_request().batch_add_service("4176", "73809,23508,33823"))
# 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_list('1', '10', '', '', '', '', '', '1', '0', '', ''))
\ No newline at end of file
......@@ -17,4 +17,76 @@ batch_add_service:
# stream_id: ${stream_id}
#service_item_ids: ${service_item_ids}
#json: {}
#isLogin: 1
\ No newline at end of file
#isLogin: 1
#OM后台-自定义专题搜索
special_list:
method: GET
url: /achelous/visual/special_list
params:
page_index: ${page_index}
page_capacity: ${page_capacity}
page_id: ${page_id}
name: ${name}
creator_name: ${creator_name}
create_time_gt: ${create_time_gt}
create_time_lt: ${create_time_lt}
is_online: ${is_online}
status: ${status}
start_time: ${start_time}
end_time: ${end_time}
data: {}
json: {}
isLogin: 1
#OM后台-自定义专题创建
special_edit:
method: POST
url: /achelous/visual/special_edit
params: {}
data:
user_id: ${stream_id}
name: ${name}
id: ${id}
start_time: ${start_time}
end_time: ${end_time}
is_online: ${is_online}
share_title: ${share_title}
share_content: ${share_content}
share_pic: ${share_pic}
json: {}
isLogin: 1
#OM后台-自定义专题删除
special_delete:
method: POST
url: /achelous/visual/special_delete
params: {}
data:
ids: ${ids}
json: {}
isLogin: 1
#OM后台-自定义专题组件库创建保存/更新保存
page_edit:
method: POST
url: /achelous/visual/page_edit
params: {}
data:
visualpage_id: ${visualpage_id}
name: ${name}
visual_info: ${visual_info}
json: {}
isLogin: 1
#OM后台-自定义专题组件创建保存/更新保存
unit_update:
method: POST
url: /achelous/visual/unit_update
params: {}
data:
page_id: ${page_id}
order: ${order}
unit: ${unit}
json: {}
isLogin: 1
\ No newline at end of file
......@@ -543,6 +543,21 @@ SETTLEMENTDELETE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/settle
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")
#OM后台-自定义专题搜索
SPECIAL_LIST = os.path.join(BASE_DIR, "backend_auto/test_om_data/achelous_data", "special_list.yaml")
#OM后台-自定义专题创建
SPECIAL_EDIT = os.path.join(BASE_DIR, "backend_auto/test_om_data/achelous_data", "special_edit.yaml")
#OM后台-自定义专题删除
SPECIAL_DELETE = os.path.join(BASE_DIR, "backend_auto/test_om_data/achelous_data", "special_delete.yaml")
#OM后台-自定义专题组件库创建保存/更新保存
PAGE_EDIT = os.path.join(BASE_DIR, "backend_auto/test_om_data/achelous_data", "page_edit.yaml")
#OM后台-自定义专题组件创建保存/更新保存
UNIT_UPDATE = os.path.join(BASE_DIR, "backend_auto/test_om_data/achelous_data", "unit_update.yaml")
#更美次卡-获取已添加页面次卡spu/sku列表
GET_RELATED_BC_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_om_api", "beautycard_request.yaml")
GET_RELATED_BC = os.path.join(BASE_DIR, "backend_auto/test_om_data/beautycard_data", "get_related_bc.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 TestPageEdit:
data = BaseRequest().api_load(path_setting.PAGE_EDIT)
page_edit_case, page_edit_data = get_ids(data,'page_edit')
@pytest.mark.parametrize("param", page_edit_data, ids=page_edit_case)
def test_page_edit(self, param):
edit = achelous_request().special_edit("32244157", "aha自定义专题创建", "0", "2021-08-01 00:00:00","2021-09-30 00:00:00", "1", "啊哈自定义专题创建标题", "啊哈自定义专题创建分享语","https://heras.igengmei.com/4d5eef0a-78dd-43b3-98b7-137d2341f106-1628565831259")
list = achelous_request().special_list('1', '10', '', '', '', '', '', '1', '0', '', '')
param['visualpage_id'] = list['data']['info_list'][0]['page_id']
param['name'] = edit['data']['name']
r = achelous_request().page_edit(param['visualpage_id'], param['name'], param['visual_info'])
if r['msg'] == 'success':
assert r['data']['visualgroup_id'] == param['assert']
print('自定义专题组件库成功保存,啦啦啦')
else:
assert r['code'] == param['assert_error']
print('自定义专题组件库保存失败,呜呜呜')
\ No newline at end of file
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 TestSpecialDelete:
data = BaseRequest().api_load(path_setting.SPECIAL_DELETE)
special_delete_case, special_delete_data = get_ids(data, "special_delete")
@pytest.mark.parametrize("param", special_delete_data, ids=special_delete_case)
def test_special_delete(self, param):
edit = achelous_request().special_edit("32244157","aha自定义专题创建","0","2021-08-01 00:00:00","2021-09-30 00:00:00","1","啊哈自定义专题创建标题","啊哈自定义专题创建分享语","https://heras.igengmei.com/4d5eef0a-78dd-43b3-98b7-137d2341f106-1628565831259")
param['ids'] = edit['data']['id']
r = achelous_request().special_delete(param['ids'])
if r['message'] == 'success':
print("自定义专题删除了")
else:
print("自定义专题无法删除")
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 TestSpecialEdit:
data = BaseRequest().api_load(path_setting.SPECIAL_EDIT)
special_edit_case, special_edit_data = get_ids(data, "special_edit")
@pytest.mark.parametrize("param", special_edit_data, ids=special_edit_case)
def test_special_edit(self, param):
r = achelous_request().special_edit(param['user_id'], param['name'], param['id'], param['start_time'], param['end_time'], param['is_online'], param['share_title'], param['share_content'], param['share_pic'])
if r['message'] == 'success':
assert r["data"]["name"] == param["assert"]
print("自定义专题创建成功~")
else:
assert r['code'] == param['assert_error']
print("自定义专题创建失败,呜呜呜")
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 TestSpecialList:
data = BaseRequest().api_load(path_setting.SPECIAL_LIST)
special_list_case, special_list_data = get_ids(data, 'special_list')
@pytest.mark.parametrize("param", special_list_data, ids= special_list_case)
def test_special_list(self,param):
r = achelous_request().special_list(param['page_index'], param['page_capacity'], param['page_id'], param['name'], param['creator_name'], param['create_time_gt'], param['create_time_lt'], param['is_online'], param['status'], param['start_time'], param['end_time'])
if r['msg'] == 'success':
assert r['data']['page_index'] == param['assert']
print('搜索自定义专题成功啦~~~')
else:
assert r['code'] == param['assert_error']
print('自定义专题搜索失败了!!!')
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 TestUnitUpdate:
data = BaseRequest().api_load(path_setting.UNIT_UPDATE)
unit_update_case, unit_update_data = get_ids(data, "unit_update")
@pytest.mark.parametrize("param", unit_update_data, ids=unit_update_case)
def test_unit_update(self, param):
edit = achelous_request().special_edit("32244157","aha自定义专题创建","0","2021-08-01 00:00:00","2021-09-30 00:00:00","1","啊哈自定义专题创建标题","啊哈自定义专题创建分享语","https://heras.igengmei.com/4d5eef0a-78dd-43b3-98b7-137d2341f106-1628565831259")
list = achelous_request().special_list('1', '10', '', '', '', '', '', '1', '0', '', '')
param['page_id'] = list['data']['info_list'][0]['page_id']
param['name'] = edit['data']['name']
r = achelous_request().unit_update(param['page_id'], param['order'], param['unit'])
if r['msg'] == 'success':
assert r['data']['unit']['module_name'] == param['assert']
print('组件成功保存啦,啦啦啦')
else:
assert r['code'] == param['assert_error']
print('组件保存失败了,呜呜呜')
#调用组件库保存接口
achelous_request().page_edit("param['page_id']", "param['name']", "r['data']['unit']")
......@@ -14,7 +14,7 @@ class TestDeleteRelatedBc:
def test_delete_related_bc(self,param):
r = beautycard_request().delete_related_bc(param["unit_id"], param["bc_sku_ids"], param["bc_spu_ids"], param["related_type"])
if r["code"] == 0:
print("成功删除已添加页面次卡")
assert r["data"] == param["assert"]
print("成功删除已添加页面次卡")
if r["code"] == 1:
print("未删除已添加页面次卡")
\ No newline at end of file
#OM后台-组件库创建保存/更新保存
page_edit:
#空组件库保存成功了
-
case: '空组件库保存成功了'
visualpage_id: ''#此字段为自定义专题的专题ID,取自自定义专题搜索接口的返参:page_id
name: ''#此字段取值无用
visual_info: '[]'
assert: 0
assert_error: 999
#OM后台-自定义专题删除
special_delete:
#自定义专题成功删除
-
case: '自定义专题成功删除'
ids: ''#该字段取值用不到
\ No newline at end of file
#OM后台-自定义专题创建
special_edit:
#成功创建自定义专题~
-
case: "成功创建自定义专题~"
user_id: '32244157'
name: aha创建自定义专题
id: 0
start_time: '2021-08-10 00:00:00'
end_time: '2022-08-10 00:00:00'
is_online: 1
share_title: 啊哈创建自定义专题分享标题
share_content: 啊哈创建自定义专题分享文案
share_pic: https://heras.igengmei.com/4d5eef0a-78dd-43b3-98b7-137d2341f106-1628565831259
assert: aha创建自定义专题
assert_error: 999
#OM后台-自定义专题搜索
special_list:
#自定义专题-无条件-搜索
-
case: '自定义专题-无条件-搜索'
page_index: 1
page_capacity: 10
page_id: ''
name: ''
creator_name: ''
create_time_gt: ''
create_time_lt: ''
is_online: 1
status: 0
start_time: ''
end_time: ''
assert: 1
aseert_error: 999
\ No newline at end of file
#OM后台-自定义专题组件创建保存/更新保存
unit_update:
#平滑式轮播图组件新增保存成功
-
case: '平滑式轮播图组件新增保存成功'
page_id: ''#此字段为自定义专题的专题ID,取自自定义专题搜索接口的返参:page_id
order: '0'
unit: '{"component_type":1,"module_name":"啊哈-平滑式轮播图","template_type":1,"images":[{"url":"https://heras.igengmei.com/105a2aa3-71a2-4e21-80b6-2de26da017ed-1628672528151","link_type":"45","link_id":"888","width":500,"height":313}],"component_style":{"background_image":{"url":"","width":0,"height":0}},"links":[{"url":"https://heras.igengmei.com/105a2aa3-71a2-4e21-80b6-2de26da017ed-1628672528151","link_type":"45","link_id":"888","width":500,"height":313}],"hash":"c2e1c300fa8211ebbe29738d54d50408"}'
assert: 啊哈-平滑式轮播图
assert_error: 999
#堆叠式轮播图组件新增保存成功
-
case: '堆叠式轮播图组件新增保存成功'
page_id: ''#此字段为自定义专题的专题ID,取自自定义专题搜索接口的返参:page_id
order: '0'
unit: '{"component_type":1,"module_name":"啊哈-堆叠式轮播图","template_type":2,"images":[{"url":"https://heras.igengmei.com/105a2aa3-71a2-4e21-80b6-2de26da017ed-1628672528151","link_type":"45","link_id":"888","width":500,"height":313}],"component_style":{"background_image":{"url":"","width":0,"height":0}},"links":[{"url":"https://heras.igengmei.com/105a2aa3-71a2-4e21-80b6-2de26da017ed-1628672528151","link_type":"45","link_id":"888","width":500,"height":313}],"hash":"c2e1c300fa8211ebbe29738d54d50408"}'
assert: 啊哈-堆叠式轮播图
assert_error: 999
\ No newline at end of file
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