Commit 491f1609 authored by aha's avatar aha

om后台-弹出美券、用户-领取美券

parent 8a791c22
......@@ -9,6 +9,8 @@ class live_request(BaseRequest):
self.data = self.api_load(path_setting.SEARCHSERVICE_CONFIG)
self.data = self.api_load(path_setting.ADDLIVESERVICE_CONFIG)
self.data = self.api_load(path_setting.POP_SERVICE_CONFIG)
self.data = self.api_load(path_setting.POP_GIFT_CONFIG)
self.data = self.api_load(path_setting.GET_GIFT_CONFIG)
self.data = self.api_load(path_setting.DELETELIVESERVICE_CONFIG)
self.data = self.api_load(path_setting.DELETEGIFT_CONFIG)
self.data = self.api_load(path_setting.M_GET_CHANNEL_STATUS_CONFIG)
......@@ -68,6 +70,19 @@ class live_request(BaseRequest):
self.params["version"] = version
return self.api_send(self.data["pop_service"])
#om后台-弹出美券
def pop_gift(self, stream_id, gift_id, version, device_id='97B6764B-2135-4761-9911-701C38CBC272'):
self.params["stream_id"] = stream_id
self.params["gift_id"] = gift_id
self.params["version"] = version
return self.api_send(self.data["pop_gift"])
#用户-领取美券
def get_gift(self, gift_id, version, device_id='97B6764B-2135-4761-9911-701C38CBC272'):
self.params["gift_id"] = gift_id
self.params["version"] = version
return self.api_send(self.data["get_gift"])
#主播-推荐袋删除商品
def delete_live_service(self, channel_id, live_service_id, version, device_id='97B6764B-2135-4761-9911-701C38CBC272'):
self.params["channel_id"] = channel_id
......@@ -119,4 +134,6 @@ if __name__ == '__main__':
#print(live_request().m_get_channel_status("745", "7.46.0"))
# print(live_request().mark_live_service("4233", "745", "7269", "1", "746.0"))
# print(live_request().audience_services("4179","739","0","20"))
print(live_request().pop_service("4266", "7324", "1", "746.0"))
\ No newline at end of file
# print(live_request().pop_service("4266", "7324", "1", "746.0"))
# print(live_request().pop_gift("4271", "59124", "746.0"))
print(live_request().get_gift( "59124", "746.0"))
\ No newline at end of file
......@@ -52,7 +52,7 @@ add_live_service:
json: {}
isLogin: 1
#主播-添加商品后,购物车上方弹出商品卡片
#主播-添加商品后,购物车上方弹出商品卡片
pop_service:
method: GET
url: /api/janus/live/pop_service
......@@ -62,7 +62,30 @@ pop_service:
pop_type: ${pop_type}
version: ${version}
data: {}
json: { }
json: {}
isLogin: 1
#om后台-弹出美券
pop_gift:
method: GET
url: /api/janus/live/pop_gift
params:
stream_id: ${stream_id}
gift_id: ${gift_id}
version: ${version}
data: {}
json: {}
isLogin: 1
#用户-领取美券
get_gift:
method: POST
url: /api/janus/live/get_gift
params:
version: ${version}
data:
gift_id: ${gift_id}
json: {}
isLogin: 1
#主播-推荐袋删除商品
......
......@@ -602,6 +602,14 @@ ADDLIVESERVICE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_li
POP_SERVICE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "janus_live_request.yaml")
POP_SERVICE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_live_data", "pop_service.yaml")
#OM后台-弹出美券
POP_GIFT_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "janus_live_request.yaml")
POP_GIFT = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_live_data", "pop_gift.yaml")
#用户-领取美券
GET_GIFT_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "janus_live_request.yaml")
GET_GIFT = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_live_data", "get_gift.yaml")
#主播-推荐袋删除商品
DELETELIVESERVICE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "janus_live_request.yaml")
DELETELIVESERVICE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_live_data", "delete_live_service.yaml")
......
import pytest
import path_setting
from all_backend_api.janus_live_request import live_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
class TestGetGift:
data = BaseRequest().api_load(path_setting.GET_GIFT)
get_gift_case, get_gift_data = get_ids(data, "get_gift")
@pytest.mark.parametrize("param", get_gift_data, ids=get_gift_case)
def test_get_gift(self,param):
r = live_request().get_gift(param["gift_id"], param["version"])
if r["message"] == "领取成功!":
print("用户成功领取美券~")
assert r["data"]["has_gift_left"] == param["assert"]
else:
print("出错了!!!")
\ No newline at end of file
import pytest
import path_setting
from all_backend_api.janus_live_request import live_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
class TestPopGift:
data = BaseRequest().api_load(path_setting.POP_GIFT)
pop_gift_case, pop_gift_data = get_ids(data, "pop_gift")
@pytest.mark.parametrize("param", pop_gift_data, ids=pop_gift_case)
def test_pop_gift(self,param):
r = live_request().pop_gift(param["stream_id"], param["gift_id"], param["version"])
if r["data"] is not None:
print("成功弹出美券")
assert r["data"]["gift_id"] == param["assert"]
else:
print("出错了!!!")
\ No newline at end of file
get_gift:
#用户-领取美券
-
case: "用户-领取美券"
gift_id: "59124"
version : "7.46.0"
assert: 1
\ No newline at end of file
pop_gift:
#在om后台添加美券后,点击弹出,直播间弹出美券
-
case: "在om后台添加美券后,点击弹出,直播间弹出美券"
stream_id: "4271"
gift_id: "59124"
version : "7.46.0"
assert: 59124
\ 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