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
ad31b5fe
Commit
ad31b5fe
authored
May 21, 2021
by
邓莹莹
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'common_dev' into dyy_dev
parents
65077b4d
021f0701
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
2 deletions
+52
-2
shopcart_request.py
all_backend_api/shopcart_request.py
+11
-2
shopcart_request.yaml
all_backend_api/shopcart_request.yaml
+13
-0
path_setting.py
path_setting.py
+2
-0
test_add.py
test_backend_case/shopcart_case/test_add.py
+18
-0
add.yaml
test_backend_data/shopcart_data/add.yaml
+8
-0
No files found.
all_backend_api/shopcart_request.py
View file @
ad31b5fe
...
...
@@ -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
all_backend_api/shopcart_request.yaml
View file @
ad31b5fe
...
...
@@ -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
path_setting.py
View file @
ad31b5fe
...
...
@@ -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"
)
...
...
test_backend_case/shopcart_case/test_add.py
0 → 100644
View file @
ad31b5fe
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"
]
test_backend_data/shopcart_data/add.yaml
0 → 100644
View file @
ad31b5fe
add
:
-
case
:
"
校验添加成功case"
from_live
:
"
"
number
:
1
service_item_id
:
"
618788"
assert_message
:
"
添加成功"
\ 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