Commit 22c68243 authored by aha's avatar aha

提交:更美次卡-获取已添加页面次卡spu/sku列表、更美次卡-删除/批量删除已添加页面次卡

parent 0d6e9bee
import path_setting
from in_common.base_request import BaseRequest
class beautycard_request(BaseRequest):
def __init__(self):
#更美次卡-获取已添加页面次卡spu/sku列表
self.data = self.api_load(path_setting.GET_RELATED_BC_CONFIG)
# 更美次卡-删除/批量删除已添加页面次卡
self.data = self.api_load(path_setting.DELETE_RELATED_BC_CONFIG)
#更美次卡-获取已添加页面次卡spu/sku列表
def get_related_bc(self, unit_id, bc_sku_id, bc_spu_id, page, page_size):
self.params["unit_id"] = unit_id
self.params["bc_sku_id"] = bc_sku_id
self.params["bc_spu_id"] = bc_spu_id
self.params["page"] = page
self.params["page_size"] = page_size
return self.api_send(self.data["get_related_bc"])
#更美次卡-删除/批量删除已添加页面次卡
def delete_related_bc(self, unit_id, bc_sku_ids, bc_spu_ids, related_type):
self.params["unit_id"] = unit_id
self.params["bc_sku_ids"] = bc_sku_ids
self.params["bc_spu_ids"] = bc_spu_ids
self.params["related_type"] = related_type
return self.api_send(self.data["delete_related_bc"])
if __name__ == '__main__':
print(beautycard_request().get_related_bc("20105", "", "", "0", "10"))
print(beautycard_request().delete_related_bc("19931", "[10163]", "[]", "8"))
\ No newline at end of file
#更美次卡-获取已添加页面次卡spu/sku列表
get_related_bc:
method : GET
url : /achelous/visual/beauty_card/get_related_bc
params :
unit_id : ${unit_id}
bc_sku_id : ${bc_sku_id}
bc_spu_id : ${bc_spu_id}
page : ${page}
page_size : ${page_size}
data : {}
json : {}
isLogin : 1
#更美次卡-删除/批量删除已添加页面次卡
delete_related_bc:
method : POST
url : /achelous/visual/beauty_card/delete_related_bc
params : {}
data :
unit_id : ${unit_id}
bc_sku_ids : ${bc_sku_ids}
bc_spu_ids : ${bc_spu_ids}
related_type : ${related_type}
json : {}
isLogin : 1
\ No newline at end of file
......@@ -8,7 +8,7 @@ class login_request(BaseRequest):
self.data = self.api_load(path_setting.OMLOGIN_CONFIG)
#om后台-登录
def om_login(self, username, password, Cookie='session_key=b3owiduporwyatpueme46orsofkfgwjv'):
def om_login(self, username, password):
self.params["username"] = username
self.params["password"] = password
......
......@@ -2,6 +2,6 @@ develop_host:
backend: http://backend.paas-develop.env
om: http://om.paas-develop.env
# om: http://om.paas-develop.env
# doctor: http://doctor.paas-develop.env
# backend: https://backend.igengmei.com
......@@ -384,6 +384,14 @@ 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")
#更美次卡-获取已添加页面次卡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")
#更美次卡-删除/批量删除已添加页面次卡
DELETE_RELATED_BC_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_om_api", "beautycard_request.yaml")
DELETE_RELATED_BC = os.path.join(BASE_DIR, "backend_auto/test_om_data/beautycard_data", "delete_related_bc.yaml")
if __name__ == '__main__':
print("==========",LIVEYAML_CONFIG)
import pytest
import path_setting
from all_om_api.beautycard_request import beautycard_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
#更美次卡-删除/批量删除已添加页面次卡
class TestDeleteRelatedBc:
data = BaseRequest().api_load(path_setting.DELETE_RELATED_BC)
delete_related_bc_case, delete_related_bc_data = get_ids(data, "delete_related_bc")
@pytest.mark.parametrize("param",delete_related_bc_data,ids=delete_related_bc_case)
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"]
if r["code"] == 1:
print("未删除已添加页面次卡")
\ No newline at end of file
import pytest
import path_setting
from all_om_api.beautycard_request import beautycard_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
#更美次卡-获取已添加页面次卡spu/sku列表
class TestGetRelatedBc:
data = BaseRequest().api_load(path_setting.GET_RELATED_BC)
get_related_bc_case, get_related_bc_data = get_ids(data, "get_related_bc")
@pytest.mark.parametrize("param",get_related_bc_data,ids=get_related_bc_case)
def test_get_related_bc(self,param):
r = beautycard_request().get_related_bc(param["unit_id"], param["bc_sku_id"], param["bc_spu_id"], param["page"], param["page_size"])
if r["data"]:
print("成功获取已添加页面次卡spu/sku列表")
assert len(r["data"]["beauty_cards"]) != param["assert"]
if not r["data"]:
print("未获取到已添加页面次卡spu/sku列表")
\ No newline at end of file
#更美次卡-删除/批量删除已添加页面次卡
delete_related_bc:
#按SPU导入-已添加页面删除单条数据
-
case : "按SPU导入-已添加页面删除单条数据"
unit_id : "19896"
bc_sku_ids : "[]"
bc_spu_ids : "[28]"
related_type : "7"
assert: 1
#按SPU导入-已添加页面删除多条数据
-
case : "按SPU导入-已添加页面删除多条数据"
unit_id : "19896"
bc_sku_ids : "[]"
bc_spu_ids : "[30,31,33]"
related_type : "7"
assert: 3
#按SKU导入-已添加页面删除单条数据
-
case : "按SKU导入-已添加页面删除单条数据"
unit_id : "19933"
bc_sku_ids : "[10144]"
bc_spu_ids : "[]"
related_type : "8"
assert: 1
#按SKU导入-已添加页面删除多条数据
-
case : "按SKU导入-已添加页面删除多条数据"
unit_id : "19933"
bc_sku_ids : "[10141,10142]"
bc_spu_ids : "[]"
related_type : "8"
assert: 2
\ No newline at end of file
#更美次卡-获取已添加页面次卡spu/sku列表
get_related_bc:
#按SPU导入-根据专题id获取已添加页面次卡spu列表
-
case : "按SPU导入-根据专题id获取已添加页面次卡spu列表"
unit_id : "20105"
bc_sku_id : ""
bc_spu_id : ""
page : "0"
page_size : "10"
assert: 0
#按SPU导入-根据专题和次卡spu_id获取已添加页面次卡spu列表
-
case : "按SPU导入-根据专题和次卡spu_id获取已添加页面次卡spu列表"
unit_id : "20105"
bc_sku_id : ""
bc_spu_id : "100023"
page : "0"
page_size : "10"
assert: 0
#按SKU导入-根据专题id获取已添加页面次卡spu列表
-
case : "按SKU导入-根据专题id获取已添加页面次卡spu列表"
unit_id : "20106"
bc_sku_id : ""
bc_spu_id : ""
page : "0"
page_size : "10"
assert: 0
#按SKU导入-根据专题和次卡spu_id获取已添加页面次卡spu列表
-
case : "按SKU导入-根据专题和次卡spu_id获取已添加页面次卡spu列表"
unit_id : "20106"
bc_sku_id : ""
bc_spu_id : "100023"
page : "0"
page_size : "10"
assert: 0
#按SKU导入-根据专题和次卡sku_id获取已添加页面次卡spu和sku列表
-
case : "按SKU导入-根据专题和次卡sku_id获取已添加页面次卡spu和sku列表"
unit_id : "20106"
bc_sku_id : "10066"
bc_spu_id : ""
page : "0"
page_size : "10"
assert: 0
#按SKU导入-根据专题和次卡spu_id、sku_id获取已添加页面次卡spu和sku列表
-
case : "按SKU导入-根据专题和次卡spu_id、sku_id获取已添加页面次卡spu和sku列表"
unit_id : "20106"
bc_sku_id : "10066"
bc_spu_id : "100023"
page : "0"
page_size : "10"
assert: 0
#按SPU导入-录入错误的spu_id,点击查询
-
case : "录入错误的spu_id,点击查询"
unit_id : "20105"
bc_sku_id : ""
bc_spu_id : "1111111111111"
page : "0"
page_size : "10"
assert: 0
#按SKU导入-录入错误的sku_id,点击查询
-
case : "录入错误的sku_id,点击查询"
unit_id : "20106"
bc_sku_id : "111111111111"
bc_spu_id : ""
page : "0"
page_size : "10"
assert: 0
\ 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