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
cdc519ef
Commit
cdc519ef
authored
Jun 08, 2021
by
aha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
次卡自定义专题
parent
233a7b7b
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
309 additions
and
0 deletions
+309
-0
visual_beauty_card.py
all_backend_api/visual_beauty_card.py
+40
-0
visual_beauty_card.yaml
all_backend_api/visual_beauty_card.yaml
+47
-0
path_setting.py
path_setting.py
+12
-0
__init__.py
test_backend_case/visual_beauty_card_case/__init__.py
+0
-0
test_beautycard_filters.py
...d_case/visual_beauty_card_case/test_beautycard_filters.py
+22
-0
test_beautycard_skus.py
...kend_case/visual_beauty_card_case/test_beautycard_skus.py
+20
-0
test_visual_beauty_card_services.py
...sual_beauty_card_case/test_visual_beauty_card_services.py
+20
-0
__init__.py
test_backend_data/visual_beauty_card_data/__init__.py
+0
-0
beautycard_filters.yaml
...kend_data/visual_beauty_card_data/beautycard_filters.yaml
+17
-0
beautycard_skus.yaml
...backend_data/visual_beauty_card_data/beautycard_skus.yaml
+110
-0
visual_beauty_card_services.yaml
.../visual_beauty_card_data/visual_beauty_card_services.yaml
+21
-0
No files found.
all_backend_api/visual_beauty_card.py
0 → 100644
View file @
cdc519ef
import
path_setting
from
in_common.base_request
import
BaseRequest
class
visual_beauty_card_request
(
BaseRequest
):
def
__init__
(
self
):
#自定义专题-更美次卡橱窗组件商品
self
.
data
=
self
.
api_load
(
path_setting
.
VISUAL_BEAUTY_CARD_SERVICES_CONFIG
)
#自定义专题-更美次卡商品列表筛选器
self
.
data
=
self
.
api_load
(
path_setting
.
BEAUTYCARD_FILTERS_CONFIG
)
#自定义专题-更美次卡橱窗组件商品
def
visual_beauty_card_services
(
self
,
unit_id
,
current_city_id
,
page
,
page_size
,
version
,
device_id
=
'97B6764B-2135-4761-9911-701C38CBC272'
):
self
.
params
[
"unit_id"
]
=
unit_id
self
.
params
[
"current_city_id"
]
=
current_city_id
self
.
params
[
"page"
]
=
page
self
.
params
[
"page_size"
]
=
page_size
self
.
params
[
"version"
]
=
version
return
self
.
api_send
(
self
.
data
[
'visual_beauty_card_services'
])
#自定义专题-更美次卡商品列表筛选器
def
beautycard_filters
(
self
,
unit_id
,
current_city_id
,
version
,
device_id
=
'97B6764B-2135-4761-9911-701C38CBC272'
):
self
.
params
[
"unit_id"
]
=
unit_id
self
.
params
[
"current_city_id"
]
=
current_city_id
self
.
params
[
"version"
]
=
version
return
self
.
api_send
(
self
.
data
[
'beautycard_filters'
])
#自定义专题-更美次卡商品列表组件商品
def
beautycard_skus
(
self
,
unit_id
,
tag_id
,
area
,
sort_type
,
page
,
page_size
,
device_id
=
'97B6764B-2135-4761-9911-701C38CBC272'
):
self
.
params
[
"unit_id"
]
=
unit_id
self
.
params
[
"tag_id"
]
=
tag_id
self
.
params
[
"area"
]
=
area
self
.
params
[
"sort_type"
]
=
sort_type
self
.
params
[
"page"
]
=
page
self
.
params
[
"page_size"
]
=
page_size
return
self
.
api_send
(
self
.
data
[
'beautycard_skus'
])
\ No newline at end of file
all_backend_api/visual_beauty_card.yaml
0 → 100644
View file @
cdc519ef
visual_beauty_card_services
:
method
:
GET
url
:
/api/janus/visual_beauty_card/services
params
:
#组件id
unit_id
:
${unit_id}
current_city_id
:
${current_city_id}
#分页
page
:
${page}
#分页大小
page_size
:
${page_size}
version
:
${version}
data
:
{}
json
:
{}
beautycard_filters
:
method
:
GET
url
:
/api/janus/visual_beauty_card/list_unit/filters
params
:
#组件id
unit_id
:
${unit_id}
current_city_id
:
${current_city_id}
version
:
${version}
data
:
{}
json
:
{}
beautycard_skus
:
method
:
GET
url
:
/api/janus/visual_beauty_card/list_unit/skus
params
:
#组件id
unit_id
:
${unit_id}
#类型筛选器(-1: 全部类型)
tag_id
:
${tag_id}
#城市筛选器
area
:
${area}
#排序方式(0: 默认排序, 1: 销量排序, 2: 价格排序, 3: 上架时间排序)
sort_type
:
${sort_type}
#分页
page
:
${page}
#分页大小
page_size
:
${page_size}
data
:
{}
json
:
{}
path_setting.py
View file @
cdc519ef
...
...
@@ -221,6 +221,18 @@ 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"
)
#更美次卡橱窗组件商品
VISUAL_BEAUTY_CARD_SERVICES_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"visual_beauty_card.yaml"
)
VISUAL_BEAUTY_CARD_SERVICES
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/visual_beauty_card_data"
,
"visual_beauty_card_services.yaml"
)
#次卡商品列表组件筛选器
BEAUTYCARD_FILTERS_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"visual_beauty_card.yaml"
)
BEAUTYCARD_FILTERS
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/visual_beauty_card_data"
,
"beautycard_filters.yaml"
)
#次卡商品列表组件商品
BEAUTYCARD_SKUS_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"visual_beauty_card.yaml"
)
BEAUTYCARD_SKUS
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/visual_beauty_card_data"
,
"beautycard_skus.yaml"
)
if
__name__
==
'__main__'
:
print
(
"=========="
,
LIVEYAML_CONFIG
)
test_backend_case/visual_beauty_card_case/__init__.py
0 → 100644
View file @
cdc519ef
test_backend_case/visual_beauty_card_case/test_beautycard_filters.py
0 → 100644
View file @
cdc519ef
import
pytest
import
path_setting
from
all_backend_api.visual_beauty_card
import
visual_beauty_card_request
from
ids_list
import
get_ids
from
in_common.base_request
import
BaseRequest
#次卡商品列表筛选器接口
class
TestBeautyCardFilters
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
BEAUTYCARD_FILTERS
)
beautycard_filters_case
,
beautycard_filters_data
=
get_ids
(
data
,
"beautycard_filters"
)
@pytest.mark.parametrize
(
"param"
,
beautycard_filters_data
,
ids
=
beautycard_filters_case
)
def
test_beautycard_filters
(
self
,
param
):
print
(
'次卡商品列表筛选器'
)
r
=
visual_beauty_card_request
()
.
beautycard_filters
(
param
[
"unit_id"
],
param
[
"current_city_id"
],
param
[
"version"
])
if
r
[
"data"
]:
print
(
'次卡商品列表筛选器下拉列表有值'
)
assert
len
(
r
[
"data"
][
"field"
])
!=
param
[
"assert"
]
assert
len
(
r
[
"data"
][
"areas"
])
!=
param
[
"assert"
]
assert
len
(
r
[
"data"
][
"order"
])
!=
param
[
"assert"
]
\ No newline at end of file
test_backend_case/visual_beauty_card_case/test_beautycard_skus.py
0 → 100644
View file @
cdc519ef
import
pytest
import
path_setting
from
all_backend_api.visual_beauty_card
import
visual_beauty_card_request
from
ids_list
import
get_ids
from
in_common.base_request
import
BaseRequest
#次卡商品列表组件商品
class
TestBeautyCardSkus
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
BEAUTYCARD_SKUS
)
beautycard_skus_case
,
beautycard_skus_data
=
get_ids
(
data
,
"beautycard_skus"
)
@pytest.mark.parametrize
(
"param"
,
beautycard_skus_data
,
ids
=
beautycard_skus_case
)
def
test_beautycard_skus
(
self
,
param
):
print
(
'次卡商品列表组件商品'
)
r
=
visual_beauty_card_request
()
.
beautycard_skus
(
param
[
"unit_id"
],
param
[
"tag_id"
],
param
[
"area"
],
param
[
"sort_type"
],
param
[
"page"
],
param
[
"page_size"
])
if
r
[
"data"
]:
print
(
'次卡商品列表组件有商品召回'
)
assert
len
(
r
[
"data"
][
"beautycards"
])
!=
param
[
"assert"
]
\ No newline at end of file
test_backend_case/visual_beauty_card_case/test_visual_beauty_card_services.py
0 → 100644
View file @
cdc519ef
import
pytest
import
path_setting
from
all_backend_api.visual_beauty_card
import
visual_beauty_card_request
from
ids_list
import
get_ids
from
in_common.base_request
import
BaseRequest
#次卡橱窗商品
class
TestVisualBeautyCardServices
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
VISUAL_BEAUTY_CARD_SERVICES
)
visual_beauty_card_services_case
,
visual_beauty_card_services_data
=
get_ids
(
data
,
"visual_beauty_card_services"
)
@pytest.mark.parametrize
(
"param"
,
visual_beauty_card_services_data
,
ids
=
visual_beauty_card_services_case
)
def
test_visual_beauty_card_services
(
self
,
param
):
print
(
'次卡橱窗'
)
r
=
visual_beauty_card_request
()
.
visual_beauty_card_services
(
param
[
"unit_id"
],
param
[
"current_city_id"
],
param
[
"page"
],
param
[
"page_size"
],
param
[
"version"
])
if
r
[
"data"
][
"beautycards"
]:
print
(
'次卡橱窗有商品'
)
assert
len
(
r
[
"data"
][
"beautycards"
])
!=
param
[
"assert"
]
\ No newline at end of file
test_backend_data/visual_beauty_card_data/__init__.py
0 → 100644
View file @
cdc519ef
test_backend_data/visual_beauty_card_data/beautycard_filters.yaml
0 → 100644
View file @
cdc519ef
beautycard_filters
:
-
#更美次卡商品列表组件筛选器-按SPU导入,筛选器接口正常
case
:
"
更美次卡商品列表组件筛选器-按SPU导入,筛选器接口正常"
unit_id
:
"
20109"
current_city_id
:
"
beijing"
version
:
"
743.0"
assert
:
0
-
#更美次卡商品列表组件筛选器-按SKU导入,筛选器接口正常
case
:
"
更美次卡商品列表组件筛选器-按SKU导入,筛选器接口正常"
unit_id
:
"
20113"
current_city_id
:
"
beijing"
version
:
"
743.0"
assert
:
0
\ No newline at end of file
test_backend_data/visual_beauty_card_data/beautycard_skus.yaml
0 → 100644
View file @
cdc519ef
beautycard_skus
:
-
#更美次卡商品列表组件商品-按SPU导入,商品默认排序
case
:
"
更美次卡商品列表组件商品-按SPU导入,商品默认排序"
unit_id
:
"
20109"
tag_id
:
"
-1"
area
:
"
worldwide"
sort_type
:
"
0"
page
:
"
0"
page_size
:
"
20"
assert
:
0
-
#更美次卡商品列表组件商品-按SKU导入,商品默认排序
case
:
"
更美次卡商品列表组件商品-按SKU导入,商品默认排序"
unit_id
:
"
20113"
tag_id
:
"
-1"
area
:
"
worldwide"
sort_type
:
"
0"
page
:
"
0"
page_size
:
"
20"
assert
:
0
-
#更美次卡商品列表组件商品-按SPU导入,商品价格最低
case
:
"
更美次卡商品列表组件商品-按SPU导入,商品价格最低"
unit_id
:
"
20110"
tag_id
:
"
-1"
area
:
"
worldwide"
sort_type
:
"
2"
page
:
"
0"
page_size
:
"
20"
assert
:
0
-
#更美次卡商品列表组件商品-按SKU导入,商品价格最低
case
:
"
更美次卡商品列表组件商品-按SKU导入,商品价格最低"
unit_id
:
"
20114"
tag_id
:
"
-1"
area
:
"
worldwide"
sort_type
:
"
2"
page
:
"
0"
page_size
:
"
20"
assert
:
0
-
#更美次卡商品列表组件商品-按SPU导入,商品销量最高
case
:
"
更美次卡商品列表组件商品-按SPU导入,商品销量最高"
unit_id
:
"
20111"
tag_id
:
"
-1"
area
:
"
worldwide"
sort_type
:
"
1"
page
:
"
0"
page_size
:
"
20"
assert
:
0
-
#更美次卡商品列表组件商品-按SKU导入,商品销量最高
case
:
"
更美次卡商品列表组件商品-按SKU导入,商品销量最高"
unit_id
:
"
20115"
tag_id
:
"
-1"
area
:
"
worldwide"
sort_type
:
"
1"
page
:
"
0"
page_size
:
"
20"
assert
:
0
-
#更美次卡商品列表组件商品-按SPU导入,商品最新上架
case
:
"
更美次卡商品列表组件商品-按SPU导入,商品最新上架"
unit_id
:
"
20112"
tag_id
:
"
-1"
area
:
"
worldwide"
sort_type
:
"
3"
page
:
"
0"
page_size
:
"
20"
assert
:
0
-
#更美次卡商品列表组件商品-按SKU导入,商品最新上架
case
:
"
更美次卡商品列表组件商品-按SKU导入,商品最新上架"
unit_id
:
"
20116"
tag_id
:
"
-1"
area
:
"
worldwide"
sort_type
:
"
3"
page
:
"
0"
page_size
:
"
20"
assert
:
0
-
#更美次卡商品列表组件商品-按SPU导入,修改城市筛选器为北京,商品正常召回
case
:
"
更美次卡商品列表组件商品-按SPU导入,修改城市筛选器为北京,商品正常召回"
unit_id
:
"
20110"
tag_id
:
"
-1"
area
:
"
beijing"
sort_type
:
"
2"
page
:
"
0"
page_size
:
"
20"
assert
:
0
-
#更美次卡商品列表组件商品-按SKU导入,修改城市筛选器为北京,商品正常召回
case
:
"
更美次卡商品列表组件商品-按SKU导入,修改城市筛选器为北京,商品正常召回"
unit_id
:
"
20115"
tag_id
:
"
-1"
area
:
"
beijing"
sort_type
:
"
1"
page
:
"
0"
page_size
:
"
20"
assert
:
0
test_backend_data/visual_beauty_card_data/visual_beauty_card_services.yaml
0 → 100644
View file @
cdc519ef
visual_beauty_card_services
:
-
#更美次卡橱窗-按SPU导入,定位北京,商品正常召回
case
:
"
更美次卡橱窗-按SPU导入,定位北京,商品正常召回"
unit_id
:
"
20105"
current_city_id
:
"
beijing"
page
:
"
0"
page_size
:
"
50"
version
:
"
743.0"
assert
:
0
-
#更美次卡橱窗-按SKU导入,定位北京,商品正常召回
case
:
"
更美次卡橱窗-按SKU导入,定位北京,商品正常召回"
unit_id
:
"
20106"
current_city_id
:
"
beijing"
page
:
"
0"
page_size
:
"
50"
version
:
"
743.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