Commit ad31b5fe authored by 邓莹莹's avatar 邓莹莹

Merge branch 'common_dev' into dyy_dev

parents 65077b4d 021f0701
......@@ -11,7 +11,16 @@ class shopcart_request(BaseRequest):
def list(self):
return self.api_send(self.data["list"])
#商祥页-加入购物车
def add(self, from_live, number, service_item_id):
self.params["from_live"] = from_live
self.params["number"] = number
self.params["service_item_id"] = service_item_id
return self.api_send(self.data["add"])
if __name__ == '__main__':
#打印购物车列表接口返回
print(shopcart_request().list())
\ No newline at end of file
print(shopcart_request().list())
#打印商祥页-加入购物车接口返回
print(shopcart_request().add("", 1, "618788"))
\ No newline at end of file
......@@ -5,4 +5,16 @@ list:
params: {}
data: {}
json: {}
isLogin: 1
#商祥页-加入购物车
add:
method: post
url: /api/shopcart/add/v1
params: {}
data:
from_live: ${from_live}
number: ${number}
service_item_id: ${service_item_id}
json: {}
isLogin: 1
\ No newline at end of file
......@@ -135,6 +135,8 @@ SERVICE_FAVOR = os.path.join(BASE_DIR, "backend_auto/test_backend_data/service_d
#商祥页-分享
SERVICES_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "services_request.yaml")
SERVICES_SHARE_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/services_data", "share_data.yaml")
#商祥页-加入购物车
SHOPCART_ADD = os.path.join(BASE_DIR, "backend_auto/test_backend_data/shopcart_data", "add.yaml")
#捜索结果页-医生/医院tab
CONTENTV6_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "search_request.yaml")
......
import pytest
from all_backend_api.shopcart_request import shopcart_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestAdd:
data = BaseRequest().api_load(path_setting.SHOPCART_ADD)
add_case, add_data = get_ids(data, "add")
@pytest.mark.parametrize("param", add_data, ids=add_case)
def test_add(self, param):
r = shopcart_request().add(param["from_live"], param["number"], param["service_item_id"])
if r["error"] == 0:
assert r["message"] == param["assert_message"]
add:
-
case: "校验添加成功case"
from_live: ""
number: 1
service_item_id: "618788"
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