Commit 373689b4 authored by 邓莹莹's avatar 邓莹莹

提交下单流程监控

parent 1b67b1be
...@@ -104,6 +104,6 @@ venv.bak/ ...@@ -104,6 +104,6 @@ venv.bak/
# mypy # mypy
.mypy_cache/ .mypy_cache/
host.yaml
.DS_Store .DS_Store
*/.DS_Store */.DS_Store
\ No newline at end of file
#wechat_prepay: wechat_prepay:
# method: post method: post
# url: /pay/wechat/prepay url: /pay/wechat/prepay
# params: params:
# current_city_id: "beijing" current_city_id: "beijing"
# version: 7.44.0 version: 7.44.0
# data: data:
# settlement_id: ${settlement_id} settlement_id: ${settlement_id}
# isLogin: 1 isLogin: 1
#
#alipay_prepay: alipay_prepay:
# method: post method: post
# url: /pay/alipay/prepay url: /pay/alipay/prepay
# params: params:
# current_city_id: "beijing" current_city_id: "beijing"
# version: 7.44.0 version: 7.44.0
# data: data:
# settlement_id: ${settlement_id} settlement_id: ${settlement_id}
# version: ${version} version: ${version}
# is_huabei: ${is_huabei} is_huabei: ${is_huabei}
# huabei_period: ${huabei_period} huabei_period: ${huabei_period}
# isLogin: 1 isLogin: 1
#
#jump: jump:
# method: post method: post
# url: /pay/jump url: /pay/jump
# params: params:
# current_city_id: "beijing" current_city_id: "beijing"
# version: 7.44.0 version: 7.44.0
# data: data:
# settlement_id: ${settlement_id} settlement_id: ${settlement_id}
# isLogin: 1 isLogin: 1
...@@ -22,15 +22,13 @@ class settlement_request(BaseRequest): ...@@ -22,15 +22,13 @@ class settlement_request(BaseRequest):
self.params["mul_orders_number"] = mul_orders_number self.params["mul_orders_number"] = mul_orders_number
return self.api_send(self.preview["pay_v1"]) return self.api_send(self.preview["pay_v1"])
def create_v1(self,service_item_id, number,platform_coupon_id,use_point,is_doctor_see,doctor_coupon_id,insurance_info,is_create_groupbuy): def create_v1(self,service_item_id, number,use_point,is_doctor_see,is_create_groupbuy,phone):
self.params["service_item_id"] = service_item_id self.params["service_item_id"] = service_item_id
self.params["number"] = number self.params["number"] = number
self.params["platform_coupon_id"] = platform_coupon_id
self.params["use_point"] = use_point self.params["use_point"] = use_point
self.params["is_doctor_see"] = is_doctor_see self.params["is_doctor_see"] = is_doctor_see
self.params["doctor_coupon_id"] = doctor_coupon_id
self.params["insurance_info"] = insurance_info
self.params["is_create_groupbuy"] = is_create_groupbuy self.params["is_create_groupbuy"] = is_create_groupbuy
self.params["phone"] = phone
return self.api_send(self.preview["create_v1"]) return self.api_send(self.preview["create_v1"])
def pay(self,id): def pay(self,id):
......
#preview_v1: preview_v1:
# method: post method: post
# url: /api/settlement/preview/v1 url: /api/settlement/preview/v1
# params: params:
# current_city_id: ${current_city_id} current_city_id: ${current_city_id}
# data: data:
# service_item_id: ${service_item_id} service_item_id: ${service_item_id}
# number: ${number} number: ${number}
# use_platform_coupon: ${use_platform_coupon} use_platform_coupon: ${use_platform_coupon}
# use_doctor_coupon: ${use_doctor_coupon} use_doctor_coupon: ${use_doctor_coupon}
# use_coupon_grey: ${use_coupon_grey} use_coupon_grey: ${use_coupon_grey}
# is_create_groupbuy: ${is_create_groupbuy} is_create_groupbuy: ${is_create_groupbuy}
# json: {} json: {}
# isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段 isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
pay_v1: pay_v1:
method: get method: get
...@@ -26,23 +26,20 @@ pay_v1: ...@@ -26,23 +26,20 @@ pay_v1:
json: {} json: {}
isLogin: 1 isLogin: 1
#create_v1: create_v1:
# method: post method: post
# url: /api/settlement/create/v1 url: /api/settlement/create/v1
# params: params:
# current_city_id: "beijing" current_city_id: "beijing"
# version: 7.44.0 version: 7.44.0
# data: data:
# service_item_id: ${service_item_id} service_item_id: ${service_item_id}
# number: ${number} number: ${number}
# phone: "18301089978" phone: ${phone}
# platform_coupon_id: ${platform_coupon_id} use_point: ${use_point}
# use_point: ${use_point} is_doctor_see: ${is_doctor_see}
# is_doctor_see: ${is_doctor_see} is_create_groupbuy: ${is_create_groupbuy}
# doctor_coupon_id: ${doctor_coupon_id} isLogin: 1
# insurance_info: ${insurance_info}
# is_create_groupbuy: ${is_create_groupbuy}
# isLogin: 1
pay: pay:
method: get method: get
......
...@@ -4,7 +4,7 @@ backend_login: ...@@ -4,7 +4,7 @@ backend_login:
params: params:
current_city_id: "beijing" current_city_id: "beijing"
data: data:
phone: "18301089928" phone: "12345654321"
password: 123456 password: 123456
lng: 116.4879672787569 lng: 116.4879672787569
lat: 39.98338452087316 lat: 39.98338452087316
......
...@@ -524,5 +524,8 @@ FREE_RECRUIT_LIST = os.path.join(BASE_DIR, "on_line_product/test_backend_data/fe ...@@ -524,5 +524,8 @@ FREE_RECRUIT_LIST = os.path.join(BASE_DIR, "on_line_product/test_backend_data/fe
PAGE_RULES_CONFIG = os.path.join(BASE_DIR, "on_line_product/all_backend_api", "janus_request.yaml") PAGE_RULES_CONFIG = os.path.join(BASE_DIR, "on_line_product/all_backend_api", "janus_request.yaml")
PAGE_RULES = os.path.join(BASE_DIR, "on_line_product/test_backend_data/janus_data", "page_rules.yaml") PAGE_RULES = os.path.join(BASE_DIR, "on_line_product/test_backend_data/janus_data", "page_rules.yaml")
#美购下单流程数据
ORDER_PROCESS_DATA = os.path.join(BASE_DIR, "on_line_product/test_backend_data/package_process_data", "order_process.yaml")
if __name__ == '__main__': if __name__ == '__main__':
print("==========",LIVEYAML_CONFIG) print("==========",LIVEYAML_CONFIG)
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.settlement_request import settlement_request
from all_backend_api.pay_request import pay_request
class TestOrderProcess:
data = BaseRequest().api_load(path_setting.ORDER_PROCESS_DATA)
order_process_case, order_process_data = get_ids(data, "order_process")
@pytest.mark.parametrize("param",order_process_data,ids=order_process_case)
def test_order_process(self,param):
preview_v1 = settlement_request().preview_v1(param["current_city_id"],param["service_item_id"],param["number"],param["use_platform_coupon"],param["use_doctor_coupon"],param["use_coupon_grey"],param["is_create_groupbuy"])
actual_pay = preview_v1["data"]["pre_payment_total_price"]
payment_final_price = preview_v1["data"]["payment_final_price"]
number = preview_v1["data"]["services"][0]["number"]
phone= preview_v1["data"]["phone"]
pay_v1 = settlement_request().pay_v1(actual_pay, payment_final_price, 0,0)
use_point = 0
is_doctor_see = 0
is_create_groupbuy = 0
create_v1 = settlement_request().create_v1(param["service_item_id"], number,use_point,is_doctor_see,is_create_groupbuy,phone)
settlememt_id = create_v1["data"]["id"]
alipay_prepay = pay_request().alipay_prepay(settlememt_id,"v1",0,0)
jump = pay_request().jump(settlememt_id)
assert jump["error"] == 0
assert alipay_prepay["error"] == 0
# print("0000000000000000",r)
order_process:
-
case: "下单流程监控"
current_city_id: "beijing"
service_item_id: 726795
number: 1
use_platform_coupon: 1
use_doctor_coupon: 1
use_coupon_grey: "true"
is_create_groupbuy: 0
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