Commit 2a5433ad authored by 张慧's avatar 张慧

商祥页-优惠券列表-领取接口

parent 888722a0
import path_setting
from in_common.base_request import BaseRequest
class hybrid_get_gift_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.HYBRID_GET_GIFT_CONFIG)
#商祥页-美券列表
def get_gift_data(self, gift_id):
self.params["gift_id"] = gift_id
return self.api_send(self.data["get_gift_data"])
if __name__ == '__main__':
#打印商祥页-优惠券列表-领取
print(hybrid_get_gift_request().get_gift_data("63302"))
\ No newline at end of file
#商祥页-优惠券列表-领取
get_gift_data:
method: post
url: /hybrid/get_gift/_data
params: {}
data:
gift_id: ${gift_id}
json: {}
isLogin: 1
\ No newline at end of file
...@@ -174,6 +174,9 @@ SHOPCART_ADD = os.path.join(BASE_DIR, "backend_auto/test_backend_data/shopcart_d ...@@ -174,6 +174,9 @@ SHOPCART_ADD = os.path.join(BASE_DIR, "backend_auto/test_backend_data/shopcart_d
#商祥页-美券列表 #商祥页-美券列表
HYBRID_GIFT_LIST_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "hybrid_gift_list_request.yaml") HYBRID_GIFT_LIST_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "hybrid_gift_list_request.yaml")
GIFT_LIST_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_gift_list_data", "gift_list_data.yaml") GIFT_LIST_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_gift_list_data", "gift_list_data.yaml")
#商祥页-优惠券列表-领取
HYBRID_GET_GIFT_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "hybrid_get_gift_request.yaml")
GET_GIFT_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_get_gift_data", "get_gift_data.yaml")
#捜索结果页-医生/医院tab #捜索结果页-医生/医院tab
CONTENTV6_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "search_request.yaml") CONTENTV6_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "search_request.yaml")
......
import pytest
from all_backend_api.hybrid_get_gift_request import hybrid_get_gift_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestGiftListData:
data = BaseRequest().api_load(path_setting.GET_GIFT_DATA)
get_gift_data_case, get_gift_data_data = get_ids(data, "get_gift_data")
@pytest.mark.parametrize("param", get_gift_data_data, ids=get_gift_data_case)
def test_get_gift_data(self, param):
r = hybrid_get_gift_request().get_gift_data(param["gift_id"])
if r["error"] == 1:
assert r["message"] == param["assert_message"]
get_gift_data:
-
case: "校验接口返回成功case"
gift_id: "111"
assert_message: "来晚咯,美券已领完!"
\ 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