Commit f5c39050 authored by 张伟男's avatar 张伟男

订单

parent effd5c63
import path_setting
from in_common.base_request import BaseRequest
class orders_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.ORDERS_MY_V2_CONFIG)
# 我的订单列表
def my_v2(self,start_num,status,version):
self.params["start_num"] = start_num
self.params["status"] = status
self.params["version"] = version
return self.api_send(self.data["my_v2"])
if __name__ == '__main__':
print(orders_request().my_v2(0,1,"7.44.0"))
my_v2:
method: get
url: /api/orders/my/v2
params:
start_num: ${start_num}
status: ${status}
version: ${version}
isLogin: 1
...@@ -98,6 +98,10 @@ GMAI_PLASTIC_ANALYSIS_V3_DATA = os.path.join(BASE_DIR, "backend_auto/test_backen ...@@ -98,6 +98,10 @@ GMAI_PLASTIC_ANALYSIS_V3_DATA = os.path.join(BASE_DIR, "backend_auto/test_backen
GMAI_PLASTIC_ANALYSIS_V2_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/gmai_data", "plastic_analysis_v2.yaml") GMAI_PLASTIC_ANALYSIS_V2_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/gmai_data", "plastic_analysis_v2.yaml")
# 新版本我的美券列表 # 新版本我的美券列表
JANUS_PRODUCT_MY_LIST_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "product_my_list.yaml") JANUS_PRODUCT_MY_LIST_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "product_my_list.yaml")
# 我的订单列表
ORDERS_MY_V2_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "orders_request.yaml")
# 订单列表
ORDERS_MY_V2_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/orders_data", "my_v2.yaml")
LOGIN_PASSWD = os.path.join(BASE_DIR, "backend_auto/test_backend_data/accounts_data", "login_passwd.yaml") LOGIN_PASSWD = os.path.join(BASE_DIR, "backend_auto/test_backend_data/accounts_data", "login_passwd.yaml")
......
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.orders_request import orders_request
class TestOrdersMyV2Waituse:
data = BaseRequest().api_load(path_setting.ORDERS_MY_V2_DATA)
my_order_waituse_case, my_order_waituse_data = get_ids(data, "waituse")
@pytest.mark.parametrize("param",my_order_waituse_data,ids=my_order_waituse_case)
def test_orders_waituse(self,param):
r = orders_request().my_v2(param["start_num"], param["status"], param["version"])
if r["error"] == 0:
orders = r["data"]["orders"]
for order in orders:
# 这个是次卡
if order["type"] == 4:
# 订单信息
order_id = order["order"]["order_id"]
order_status = order["order"]["order_status"]["status"]
order_statust = order["order"]["order_status"]["text"]
gm_url = order["gm_url"]
print(order_id, order_status, order_statust, gm_url)
assert order_status == param["beauty_card_order_status"]
assert order_statust == param["beauty_card_order_statust"]
assert gm_url == param["beauty_card_order_gmurl"].format(order_id)
# 按钮信息,预约
beauty_card_payment_order_wait_used_title = order["buttons"][0]["title"]
beauty_card_payment_order_wait_used_url = order["buttons"][0]["url"]
assert beauty_card_payment_order_wait_used_title == param["beauty_card_button_title"]
assert beauty_card_payment_order_wait_used_url == param["beauty_card_button_gmurl"].format(order_id)
# 7.44.0加的领取面膜按钮
beauty_card_free_service_title = order["buttons"][1]["title"]
assert beauty_card_free_service_title == param["beauty_card_button_mianmo_title"]
# 普通美购订单
if order["type"] == 0:
# 订单信息
order_id = order["order"]["order_id"]
order_status = order["order"]["order_status"]["status"]
order_statust = order["order"]["order_status"]["text"]
assert order_status == param["putong_card_order_status"]
assert order_statust == param["putong_card_order_statust"]
print(order_status, order_statust)
waituse:
#待使用
-
case: "待使用tab"
start_num: 0
status: 1
version: "7.44.0"
beauty_card_order_status : 4
beauty_card_order_statust : "待使用"
beauty_card_order_gmurl : "gengmei://order_beauty_card_detail?order_id={}&type=4"
beauty_card_button_title : "预约服务"
beauty_card_button_gmurl : "gengmei://order_beauty_card_reserve?order_id={}"
beauty_card_button_mianmo_title : "立即领取面膜"
putong_card_order_status : "1"
putong_card_order_statust : "待使用"
\ 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