Commit 6c696aac authored by 邓莹莹's avatar 邓莹莹

美购下单流程case

parent 9f5a8672
import path_setting
from in_common.base_request import BaseRequest
class pay_request(BaseRequest):
def __init__(self):
self.wechat_pay = self.api_load(path_setting.WECHAT_PAY)
def wechat_prepay(self, settlement_id):
self.params["settlement_id"] = settlement_id
return self.api_send(self.wechat_pay["wechat_prepay"])
def alipay_prepay(self, settlement_id, version,is_huabei,huabei_period):
self.params["settlement_id"] = settlement_id
self.params["version"] = version
self.params["is_huabei"] = is_huabei
self.params["huabei_period"] = huabei_period
return self.api_send(self.preview["pay_v1"])
def jump(self,ee,settlement_id):
self.params["settlement_id"] = settlement_id
return self.api_send(self.preview["create_v1"])
if __name__ == '__main__':
# print(settlement_request().preview_v1("beijing", "599428", 1, 1, 1, "true", 0))
print(pay_request().wechat_prepay(522139664651))
\ No newline at end of file
wechat_prepay:
method: post
url: /pay/wechat/prepay
params:
current_city_id: "beijing"
version: 7.44.0
data:
settlement_id: ${settlement_id}
isLogin: 1
import path_setting
from in_common.base_request import BaseRequest
class settlement_request(BaseRequest):
def __init__(self):
self.preview = self.api_load(path_setting.PREVIEW_V1)
def preview_v1(self, current_city_id, service_item_id, number, use_platform_coupon, use_doctor_coupon, use_coupon_grey, is_create_groupbuy):
self.params["current_city_id"] = current_city_id
self.params["service_item_id"] = service_item_id
self.params["number"] = number
self.params["use_platform_coupon"] = use_platform_coupon
self.params["use_doctor_coupon"] =use_doctor_coupon
self.params["use_coupon_grey"] = use_coupon_grey
self.params["is_create_groupbuy"] = is_create_groupbuy
return self.api_send(self.preview["preview_v1"])
def pay_v1(self, actual_pay, payment_final_price, is_contains_groupbuy_order,mul_orders_number):
self.params["actual_pay"] = actual_pay
self.params["payment_final_price"] = payment_final_price
self.params["is_contains_groupbuy_order"] = is_contains_groupbuy_order
self.params["mul_orders_number"] = mul_orders_number
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):
self.params["service_item_id"] = service_item_id
self.params["number"] = number
self.params["platform_coupon_id"] = platform_coupon_id
self.params["use_point"] = use_point
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
return self.api_send(self.preview["create_v1"])
def pay(self,id):
self.params["id"] = id
return self.api_send(self.preview["pay"])
if __name__ == '__main__':
# print(settlement_request().preview_v1("beijing", "599428", 1, 1, 1, "true", 0))
print(settlement_request().create_v1(599428, 1, "", 0,1, "", [], 0))
\ No newline at end of file
preview_v1:
method: post
url: /api/settlement/preview/v1
params:
current_city_id: ${current_city_id}
data:
service_item_id: ${service_item_id}
number: ${number}
use_platform_coupon: ${use_platform_coupon}
use_doctor_coupon: ${use_doctor_coupon}
use_coupon_grey: ${use_coupon_grey}
is_create_groupbuy: ${is_create_groupbuy}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
pay_v1:
method: get
url: /api/settlement/pay/v1
params:
current_city_id: "beijing"
actual_pay: ${actual_pay}
payment_final_price: ${payment_final_price}
is_contains_groupbuy_order: ${is_contains_groupbuy_order}
mul_orders_number: ${mul_orders_number}
data: {}
json: {}
isLogin: 1
create_v1:
method: post
url: /api/settlement/create/v1
params:
current_city_id: "beijing"
version: 7.44.0
data:
service_item_id: ${service_item_id}
number: ${number}
phone: "18301089978"
platform_coupon_id: ${platform_coupon_id}
use_point: ${use_point}
is_doctor_see: ${is_doctor_see}
doctor_coupon_id: ${doctor_coupon_id}
insurance_info: ${insurance_info}
is_create_groupbuy: ${is_create_groupbuy}
isLogin: 1
pay:
method: get
url: /api/settlement/pay
params:
current_city_id: "beijing"
id: ${id}
version: 7.44.0
data: {}
isLogin: 1
develop_host:
# backend: http://backend.paas-develop.env
doctor: http://doctor.paas-develop.env
backend: http://backend.paas-develop.env
# doctor: http://doctor.paas-develop.env
# backend: https://backend.igengmei.com
......@@ -218,7 +218,7 @@ POLYMER_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "janus_r
POLYMER = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "polymer.yaml")
THIRD_PHONE_LOGIN_CONFIG = os.path.join(BASE_DIR,"backend_auto/all_backend_api", "thirdphonelogin_request")
THIRD_PHONE_LOGIN =os.path.join(BASE_DIR,"backend_auto/test_backend_data/account_data","login_thirdphone")
THIRD_PHONE_LOGIN =os.path.join(BASE_DIR,"backend_auto/test_backend_data/account_data","login_thirdphone.yaml")
......@@ -242,6 +242,17 @@ REPLY_ANSWER = os.path.join(BASE_DIR, "backend_auto/test_backend_data/question_d
DETAIL_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "answer_request.yaml")
DETAIL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/answer_data", "detail.yaml")
#普通美购提交订单页
PREVIEW_V1 = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "settlement_request.yaml")
WECHAT_PAY = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "pay_request.yaml")
PREVIEW = os.path.join(BASE_DIR, "backend_auto/test_backend_data/settlement_data", "preview_v1.yaml")
PAY_V1 = os.path.join(BASE_DIR, "backend_auto/test_backend_data/settlement_data", "pay_v1.yaml")
CREATE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/settlement_data", "create_v1.yaml")
PAY = os.path.join(BASE_DIR, "backend_auto/test_backend_data/settlement_data", "pay.yaml")
WECHARTPAYDATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/pay_data", "wechat_prepay.yaml")
if __name__ == '__main__':
print("==========",LIVEYAML_CONFIG)
......@@ -14,7 +14,7 @@ class TestThirdPhoneLogin:
def test_thirdphone_login(self,param):
r = thirdphonelogin_request().thirdphone_login(param["version"],param["phone_data"],param["phone_from_type"])
print('______',r)
if r["error"] == 1:
assert r['message'] == param["assert"]
\ No newline at end of file
import pytest
import path_setting
from all_backend_api.pay_request import pay_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
class TestWechatPrepay:
data = BaseRequest().api_load(path_setting.WECHARTPAYDATA)
wechart_case, wechart_data = get_ids(data, "wechart_pay")
@pytest.mark.parametrize("param", wechart_data, ids=wechart_case)
def test_wechart_prepay(self, param):
pass
# r = pay_request().wechat_prepay()
# print(r)
# assert r["error"] == param["assert"]
import pytest
import path_setting
from all_backend_api.settlement_request import settlement_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
class TestCreateV1:
data = BaseRequest().api_load(path_setting.CREATE)
create_case, create_data = get_ids(data, "create_v1")
print(create_data)
@pytest.mark.parametrize("param", create_data, ids=create_case)
def test_create_v1(self, param):
r = settlement_request().create_v1(param["service_item_id"],param["number"],param["platform_coupon_id"],param["use_point"],param["is_doctor_see"],param["doctor_coupon_id"],param["insurance_info"],param["is_create_groupbuy"])
print(r)
assert r["error"] == param["assert"]
import pytest
import path_setting
from all_backend_api.settlement_request import settlement_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
class TestPay:
data = BaseRequest().api_load(path_setting.PAY)
pay_case, pay_data = get_ids(data, "pay")
@pytest.mark.parametrize("param", pay_data, ids=pay_case)
def test_pay(self, param):
pay_r = settlement_request().create_v1(param["service_item_id"],param["number"],param["platform_coupon_id"],param["use_point"],param["is_doctor_see"],param["doctor_coupon_id"],param["insurance_info"],param["is_create_groupbuy"])
id = pay_r["data"]["id"]
r = settlement_request().pay(id)
assert r["error"] == param["assert"]
import pytest
import path_setting
from all_backend_api.settlement_request import settlement_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
class TestPayV1:
data = BaseRequest().api_load(path_setting.PAY_V1)
pay_case, pay_data = get_ids(data, "pay_v1")
@pytest.mark.parametrize("param", pay_data, ids=pay_case)
def test_pay_v1(self, param):
r = settlement_request().pay_v1(param["actual_pay"],param["payment_final_price"],param["is_contains_groupbuy_order"],param["mul_orders_number"])
print(r)
assert r["error"] == param["assert"]
import pytest
import path_setting
from all_backend_api.settlement_request import settlement_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
class TestPreviewV1:
data = BaseRequest().api_load(path_setting.PREVIEW)
preview_case, preview_data = get_ids(data, "preview_v1")
@pytest.mark.parametrize("param", preview_data, ids=preview_case)
def test_preview_v1(self, param):
r = 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"])
print(r)
assert r["error"] == param["assert"]
login_thirdphone:
- case: "无版本号手机号一键登录case"
-
case: "无版本号手机号一键登录case"
phone_data: '{
"token" : "A4-lVEf_Fk2ekkxSFgSZ59yD6bPaIxHWzJfsGgaEBDrbZzFyxMueOODIoBeXXQuHU8REjG42jvyjQa2a3rkDm8ufKlI8DL3ny2FfxnUrnuQOycWRaHKN3664onbOetr54dvb4wkVaV7X33yBlw7u_ZCNqIOwTnRQ9kPgHDBpvyN4NTdYYf2tJWhF4VeiVOqc7OiRz-Nzt08AUvbtWpw6sPQjA==",
"appId" : "xK5yFMfJ"
......@@ -9,7 +10,8 @@ login_thirdphone:
version:
assert: "获取手机号失败"
- case: "大于7.32手机号一键登录case"
-
case: "大于7.32手机号一键登录case"
phone_data: '{
"token" : "A4-lVEf_Fk2ekkxSFgSZ59yD6bPaIxHWzJfsGgaEBDrbZzFyxMueOODIoBeXXQuHU8REjG42jvyjQa2a3rkDm8ufKlI8DL3ny2FfxnUrnuQOycWRaHKN3664onbOetr54dvb4wkVaV7X33yBlw7u_ZCNqIOwTnRQ9kPgHDBpvyN4NTdYYf2tJWhF4VeiVOqc7OiRz-Nzt08AUvbtWpw6sPQjA==",
"appId" : "xK5yFMfJ"
......@@ -18,7 +20,8 @@ login_thirdphone:
version: "7.43.0"
assert: "获取手机号失败"
- case: "小于7.32手机号一键登录case"
-
case: "小于7.32手机号一键登录case"
phone_data: '{
"token" : "A4-lVEf_Fk2ekkxSFgSZ59yD6bPaIxHWzJfsGgaEBDrbZzFyxMueOODIoBeXXQuHU8REjG42jvyjQa2a3rkDm8ufKlI8DL3ny2FfxnUrnuQOycWRaHKN3664onbOetr54dvb4wkVaV7X33yBlw7u_ZCNqIOwTnRQ9kPgHDBpvyN4NTdYYf2tJWhF4VeiVOqc7OiRz-Nzt08AUvbtWpw6sPQjA==",
"appId" : "xK5yFMfJ"
......
wechart_pay:
-
case: "普通美购订单支付流程--微信支付"
assert: 0
create_v1:
-
case: "普通美购下单--获取支付类型接口"
service_item_id: 599428
number: 1
platform_coupon_id: ""
use_point: 0
is_doctor_see: 1
doctor_coupon_id: ""
insurance_info: "[]"
is_create_groupbuy: 0
assert: 0
pay:
-
case: "普通美购下单流程--生成支付金额等信息"
service_item_id: 599428
number: 1
platform_coupon_id: ""
use_point: 0
is_doctor_see: 1
doctor_coupon_id: ""
insurance_info: "[]"
is_create_groupbuy: 0
assert: 0
\ No newline at end of file
pay_v1:
-
case: "普通美购下单流程--获取支付类型接口"
actual_pay: 656
payment_final_price: 2624
is_contains_groupbuy_order: "false"
mul_orders_number: "false"
assert: 0
preview_v1:
-
case: "普通美购下单流程--确认订单页面sucess"
current_city_id: "beijing"
service_item_id: 599428
number: 1
use_platform_coupon: 1
use_doctor_coupon: 1
use_coupon_grey: "true"
is_create_groupbuy: 0
assert: 0
\ 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