Commit 69804cc2 authored by 张淑琴's avatar 张淑琴

Merge branch 'common_dev' into zzsq_dev

parents f5963a64 86842468
......@@ -180,6 +180,11 @@ class janus_request(BaseRequest):
self.params['tab_id'] = tab_id
return self.api_send(self.data['coupon_my_list'])
# 次卡订单详情页(未使用 和 部分使用 和 已使用)
def beauty_card_order_detail(self,order_id):
self.params['order_id'] = order_id
return self.api_send(self.data['beauty_card_order_detail'])
if __name__ == '__main__':
# #打印购物车-猜你喜欢列表接口返回
......@@ -218,7 +223,7 @@ if __name__ == '__main__':
# #打印次卡-申请退款接口返回
# print(janus_request().beauty_card_refund_info("102217820485006"))
#打印次卡-提交退款申请接口返回
print(janus_request().beauty_card_refund_submit("102813852173916", 3, "个人身体原因", 0))
# print(janus_request().beauty_card_refund_submit("102813852173916", 3, "个人身体原因", 0))
print(janus_request().beauty_card_order_detail(102247770691611))
# print(janus_request().product_my_list(0, 0))
......@@ -244,3 +244,12 @@ coupon_my_list:
isLogin: 1
#次卡-订单详情(未使用 和 部分使用 和 已使用)
beauty_card_order_detail:
method: get
url: /api/janus/beauty_card/order/detail
params:
order_id: ${order_id}
data: {}
json: {}
isLogin: 1
\ No newline at end of file
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
......
develop_host:
# backend: http://backend.paas-develop.env
# om: http://om.paas-develop.env
doctor: http://doctor.paas-develop.env
backend: http://backend.paas-develop.env
# om: http://om.paas-develop.env
# doctor: http://doctor.paas-develop.env
# backend: https://backend.igengmei.com
......@@ -318,6 +318,9 @@ BEAUTY_CARD_REFUND_INFO = os.path.join(BASE_DIR, "backend_auto/test_backend_data
#次卡-提交退款申请
BEAUTY_CARD_REFUND_SUBMIT = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "beauty_card_refund_submit.yaml")
# 次卡订单详情页(未使用 部分使用 和 已使用)
BEAUTY_CARD_ORDER_DETAIL_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "beauty_card_order_detail.yaml")
#捜索结果页-医生/医院tab
CONTENTV6_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "search_request.yaml")
CONTENTV6 = os.path.join(BASE_DIR, "backend_auto/test_backend_data/search_data", "content_v6.yaml")
......@@ -431,6 +434,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
from all_backend_api.janus_request import janus_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestBeautyCardOrderDetailUsed:
data = BaseRequest().api_load(path_setting.BEAUTY_CARD_ORDER_DETAIL_DATA)
beauty_card_order_detail_used_case, beauty_card_order_detail_used_data = get_ids(data, "beauty_card_order_detail_used")
@pytest.mark.parametrize("param", beauty_card_order_detail_used_data, ids=beauty_card_order_detail_used_case)
def test_beauty_card_order_detail_used(self, param):
r = janus_request().beauty_card_order_detail(param["order_id"])
data = r["data"]
assert data["order_status"] == param["order_status"]
assert data["vertifi_detail"] == {}
used_beautycard_detail = data["used_beautycard_detail"]
title = used_beautycard_detail["title"]
used_time = used_beautycard_detail["used_time"]
hospital_name = used_beautycard_detail["hospital_name"]
assert title is not None
assert hospital_name is not None
import datetime
time = datetime.datetime.strptime(used_time,"%Y-%m-%d %H:%M:%S")
assert time < datetime.datetime.now()
print(time)
import pytest
from all_backend_api.janus_request import janus_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestBeautyCardOrderDetailUsing:
data = BaseRequest().api_load(path_setting.BEAUTY_CARD_ORDER_DETAIL_DATA)
beauty_card_order_detail_using_case, beauty_card_order_detail_using_data = get_ids(data, "beauty_card_order_detail_using")
@pytest.mark.parametrize("param", beauty_card_order_detail_using_data, ids=beauty_card_order_detail_using_case)
def test_beauty_card_order_detail_used(self, param):
r = janus_request().beauty_card_order_detail(param["order_id"])
data = r["data"]
assert data["order_status"] == param["order_status"]
assert data["vertifi_detail"]["vertifi_count"] == param["vertifi_count"]
used_beautycard_detail = data["used_beautycard_detail"]
title = used_beautycard_detail["title"]
used_time = used_beautycard_detail["used_time"]
hospital_name = used_beautycard_detail["hospital_name"]
assert title is not None
assert hospital_name is not None
import datetime
time = datetime.datetime.strptime(used_time,"%Y-%m-%d %H:%M:%S")
assert time < datetime.datetime.now()
print(time)
import pytest
from all_backend_api.janus_request import janus_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestBeautyCardOrderDetailWaitUse:
data = BaseRequest().api_load(path_setting.BEAUTY_CARD_ORDER_DETAIL_DATA)
beauty_card_order_detail_waituse_case, beauty_card_order_detail_waituse_data = get_ids(data, "beauty_card_order_detail_waituse")
@pytest.mark.parametrize("param", beauty_card_order_detail_waituse_data, ids=beauty_card_order_detail_waituse_case)
def test_beauty_card_order_detail_used(self, param):
r = janus_request().beauty_card_order_detail(param["order_id"])
data = r["data"]
assert data["order_status"] == param["order_status"]
assert data["vertifi_detail"]["vertifi_count"] == param["vertifi_count"]
used_beautycard_detail = data["used_beautycard_detail"]
assert used_beautycard_detail == {}
......@@ -15,6 +15,7 @@ class TestSettlementDelete:
def test_settlement_delete(self, param):
r = orders_request().my_v2(param["start_num"],param["status"],param["version"])
for item in r["data"]["orders"]:
if item["type"] == 1:
item = item
break
# print("999999999999999",item["settlement_id"])
......
beauty_card_order_detail_used:
-
case: "已使用次卡订单详情页"
order_id: 102247770691611
order_status: "5"
beauty_card_order_detail_using:
-
case: "部分使用次卡订单详情页"
order_id: 102794850373958
order_status: "4"
vertifi_count: "1"
beauty_card_order_detail_waituse:
-
case: "未使用次卡订单详情页"
order_id: 102625993440278
order_status: "4"
vertifi_count: "2"
\ No newline at end of file
......@@ -2,7 +2,7 @@ reply_create:
- assert1: null
case: 日记贴一级评论创建--正常校验&创建二级评论--正常校验
channel: benzhan
content: ces测试+2021-06-15 17:03:51
content: ces测试+2021-06-16 16:08:57
message: 请勿回复重复内容
message1: 回复成功
message2: 你的回复有点频繁,稍后再来
......
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