Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
backend_auto
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
邓莹莹
backend_auto
Commits
6c696aac
Commit
6c696aac
authored
Jun 08, 2021
by
邓莹莹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
美购下单流程case
parent
9f5a8672
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
302 additions
and
7 deletions
+302
-7
pay_request.py
all_backend_api/pay_request.py
+27
-0
pay_request.yaml
all_backend_api/pay_request.yaml
+11
-0
settlement_request.py
all_backend_api/settlement_request.py
+44
-0
settlement_request.yaml
all_backend_api/settlement_request.yaml
+56
-0
host.yaml
host.yaml
+2
-2
path_setting.py
path_setting.py
+12
-1
test_thirdPhone_login.py
test_backend_case/account_case/test_thirdPhone_login.py
+2
-1
__init__.py
test_backend_case/pay_case/__init__.py
+0
-0
test_wechat_prepay.py
test_backend_case/pay_case/test_wechat_prepay.py
+19
-0
__init__.py
test_backend_case/settlement_case/__init__.py
+0
-0
test_create_v1.py
test_backend_case/settlement_case/test_create_v1.py
+19
-0
test_pay.py
test_backend_case/settlement_case/test_pay.py
+19
-0
test_pay_v1.py
test_backend_case/settlement_case/test_pay_v1.py
+18
-0
test_preview_v1.py
test_backend_case/settlement_case/test_preview_v1.py
+18
-0
login_thirdphone.yaml
test_backend_data/account_data/login_thirdphone.yaml
+6
-3
__init__.py
test_backend_data/pay_data/__init__.py
+0
-0
wechat_prepay.yaml
test_backend_data/pay_data/wechat_prepay.yaml
+4
-0
__init__.py
test_backend_data/settlement_data/__init__.py
+0
-0
create_v1.yaml
test_backend_data/settlement_data/create_v1.yaml
+12
-0
pay.yaml
test_backend_data/settlement_data/pay.yaml
+13
-0
pay_v1.yaml
test_backend_data/settlement_data/pay_v1.yaml
+8
-0
preview_v1.yaml
test_backend_data/settlement_data/preview_v1.yaml
+12
-0
No files found.
all_backend_api/pay_request.py
0 → 100644
View file @
6c696aac
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
all_backend_api/pay_request.yaml
0 → 100644
View file @
6c696aac
wechat_prepay
:
method
:
post
url
:
/pay/wechat/prepay
params
:
current_city_id
:
"
beijing"
version
:
7.44.0
data
:
settlement_id
:
${settlement_id}
isLogin
:
1
all_backend_api/settlement_request.py
0 → 100644
View file @
6c696aac
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
all_backend_api/settlement_request.yaml
0 → 100644
View file @
6c696aac
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
host.yaml
View file @
6c696aac
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
path_setting.py
View file @
6c696aac
...
...
@@ -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
)
test_backend_case/account_case/test_thirdPhone_login.py
View file @
6c696aac
...
...
@@ -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
test_backend_case/pay_case/__init__.py
0 → 100644
View file @
6c696aac
test_backend_case/pay_case/test_wechat_prepay.py
0 → 100644
View file @
6c696aac
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"]
test_backend_case/settlement_case/__init__.py
0 → 100644
View file @
6c696aac
test_backend_case/settlement_case/test_create_v1.py
0 → 100644
View file @
6c696aac
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"
]
test_backend_case/settlement_case/test_pay.py
0 → 100644
View file @
6c696aac
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"
]
test_backend_case/settlement_case/test_pay_v1.py
0 → 100644
View file @
6c696aac
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"
]
test_backend_case/settlement_case/test_preview_v1.py
0 → 100644
View file @
6c696aac
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"
]
test_backend_data/account_data/login_thirdphone
→
test_backend_data/account_data/login_thirdphone
.yaml
View file @
6c696aac
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"
...
...
test_backend_data/pay_data/__init__.py
0 → 100644
View file @
6c696aac
test_backend_data/pay_data/wechat_prepay.yaml
0 → 100644
View file @
6c696aac
wechart_pay
:
-
case
:
"
普通美购订单支付流程--微信支付"
assert
:
0
test_backend_data/settlement_data/__init__.py
0 → 100644
View file @
6c696aac
test_backend_data/settlement_data/create_v1.yaml
0 → 100644
View file @
6c696aac
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
test_backend_data/settlement_data/pay.yaml
0 → 100644
View file @
6c696aac
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
test_backend_data/settlement_data/pay_v1.yaml
0 → 100644
View file @
6c696aac
pay_v1
:
-
case
:
"
普通美购下单流程--获取支付类型接口"
actual_pay
:
656
payment_final_price
:
2624
is_contains_groupbuy_order
:
"
false"
mul_orders_number
:
"
false"
assert
:
0
test_backend_data/settlement_data/preview_v1.yaml
0 → 100644
View file @
6c696aac
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment