Commit 979c1da3 authored by aha's avatar aha

Merge branch 'common_dev' into cuixin_dev

parents 491f1609 0aae8b30
......@@ -47,4 +47,12 @@ class diary_request(BaseRequest):
self.params["topic_list"] = topic_list
return self.api_send(self.data["update"])
# 日记本卡片点赞
def diary_vote(self, diary_id):
self.params["diary_id"] = diary_id
return self.api_send(self.data["vote"])
# 日记本卡片取消点赞
def diary_cancel_vote(self, diary_id):
self.params["diary_id"] = diary_id
return self.api_send(self.data["cancel_vote"])
......@@ -78,3 +78,25 @@ update:
topic_list: ${topic_list}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#日记本卡片的点赞
vote:
method: post
url: /api/diary/vote
params:
data:
diary_id: ${diary_id}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#日记本卡片的取消点赞
cancel_vote:
method: post
url: /api/diary/cancel_vote
params:
data:
diary_id: ${diary_id}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
......@@ -248,6 +248,19 @@ class janus_request(BaseRequest):
self.params["rosy"] = rosy
return self.api_send(self.data["beauty_post"])
# 日记点击大图--关联美购--除了id外其余用默认参数代替
def sales_lead_spu_by_diary(self, diary_id, current_city_id='beijing',
device_id='91B499C2-1CA2-4CB2-F118-658C87BC1795',
lat='39.98318403526738', lng='116.4880823948151'):
self.params["diary_id"] = diary_id
self.params["current_city_id"] = current_city_id
self.params["device_id"] = device_id
self.params["lat"] = lat
self.params["lng"] = lng
return self.api_send(self.data["sales_lead_spu_by_diary"])
#
if __name__ == '__main__':
......
......@@ -340,4 +340,19 @@ beauty_post:
white: ${white}
rosy: ${rosy}
json: {}
isLogin: 1
\ No newline at end of file
isLogin: 1
#日记点击大图--关联美购--除了id外其余用默认参数代替
sales_lead_spu_by_diary:
method: get
url: /api/janus/sales_lead/spu_by_diary
params:
diary_id: ${diary_id}
current_city_id: ${current_city_id}
device_id: ${device_id}
lat: ${lat}
lng: ${lng}
data: {}
json: {}
isLogin: 0
\ No newline at end of file
import path_setting
from in_common.base_request import BaseRequest
class query_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.QUERY_CONFIG)
# 详情页预置词
def preset_words(self, id,type ):
self.params["id"] = id
self.params["type"] = type
return self.api_send(self.data["preset_words"])
#详情页预置词
preset_words:
method: get
url: /api/query/preset_words
params:
id: ${id}
type: ${type}
data:
json: {}
isLogin: 0 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
......@@ -48,13 +48,16 @@ class web2_request(BaseRequest):
def artemis_ad_add_shopping_cart_info(self):
#我的购物车
return self.api_send(self.SERVICE_URL["artemis_ad_add_shopping_cart_info"])
def artemis_add_value_order_id_detail(self):
"我的服务订单-已购买"
return self.api_send(self.SERVICE_URL["artemis_add_value_order_id_detail"])
def artemis_ad_packageorder_detail(self, package_order_id):
"我的服务订单-已支付广告包"
self.params["package_order_id"] = package_order_id
return self.api_send(self.SERVICE_URL["artemis_ad_packageorder_detail"])
def artemis_cpc_categorypromotemanage_list(self, promote_flag,id):
"点点通商品-品类推广管理"
self.params["promote_flag"] = promote_flag
......@@ -67,6 +70,14 @@ class web2_request(BaseRequest):
self.params["flag_relation"] = flag_relation
return self.api_send(self.SERVICE_URL["artemis_cpc_category_query"])
def artemis_cpc_category_service_ids(self, page, pagesize, is_online, category_id):
"品类推广管理-新增推广品类-关联美购"
self.params["page"] = page
self.params["pagesize"] = pagesize
self.params["is_online"] = is_online
self.params["category_id"] = category_id
return self.api_send(self.SERVICE_URL["artemis_cpc_category_service_ids"])
if __name__ == '__main__':
print(web2_request().service_list("1", "10", "-1", "-1"))
......@@ -80,4 +91,5 @@ if __name__ == '__main__':
print(web2_request().artemis_ad_packageorder_detail("685529883901"))
print(web2_request().artemis_cpc_categorypromotemanage_list(-1,-1))
print(web2_request().artemis_cpc_category_query("wangyang", 0))
print(web2_request().artemis_cpc_category_service_ids(1, 10, -1, 8))
......@@ -109,4 +109,16 @@ artemis_cpc_category_query:
flag_relation: ${flag_relation}
data: {}
json: {}
isLogin: 1 #需要登录
artemis_cpc_category_service_ids:
method: get
url: /api/web2/artemis/cpc/category/service_ids
params:
page: ${page}
pagesize: ${pagesize}
is_online: ${is_online}
category_id: ${category_id}
data: {}
json: {}
isLogin: 1 #需要登录
\ No newline at end of file
import path_setting
from in_common.base_request import BaseRequest
class achelous_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.ACHELOUS_REQUEST_CONFIG)
def batch_add_service(self, stream_id, service_item_ids):
self.params["stream_id"] = stream_id
self.params["service_item_ids"] = service_item_ids
return self.api_send(self.data["batch_add_service"])
#def batch_del_service(self, stream_id, service_item_ids):
# self.params["stream_id"] = stream_id
# self.params["service_item_ids"] = service_item_ids
# return self.api_send(self.data["batch_add_service"])
if __name__ == "__main__":
print(achelous_request().batch_add_service("4176", "73809,23508,33823"))
# print(achelous_request().batch_del_service("4176","7312,7311"))
\ No newline at end of file
batch_add_service:
method: post
url: /achelous/live/batch_add_service
params: {}
data:
stream_id: ${stream_id}
service_item_ids: ${service_item_ids}
json: {}
isLogin: 1
#batch_del_service:
# method: post
#url: /achelous/live/batch_del_service
#params: {}
#data:
# stream_id: ${stream_id}
#service_item_ids: ${service_item_ids}
#json: {}
#isLogin: 1
\ No newline at end of file
......@@ -22,6 +22,8 @@ DIARY_FAVOR = os.path.join(BASE_DIR, "backend_auto/test_backend_data/diary_data"
DIARY_OPERATION = os.path.join(BASE_DIR, "backend_auto/test_backend_data/diary_data", "diary_operation.yaml")
# 日记本创建日记贴信息-
DIARY_UPDATE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/diary_data", "diary_update.yaml")
# 日记本点赞&取消点赞
DIARY_VOTE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/diary_data", "vote.yaml")
# 日记本创建添加医院-- auto_complete 总配置项
......@@ -31,6 +33,15 @@ AUTO_COMPLE_HOSPITAL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/au
AUTO_COMPLE_DOCTOR = os.path.join(BASE_DIR, "backend_auto/test_backend_data/auto_complete_data", "doctor.yaml")
# 详情页搜索预置词--query 总配置项
QUERY_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "query_request.yaml")
QUERY_PRESET_WORDS = os.path.join(BASE_DIR, "backend_auto/test_backend_data/query_data", "preset_words.yaml")
# 日记大图召回美购
SPU_BY_DIARY = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "sales_lead_spu_by_diary.yaml")
# 日记本进入相册页
DIARY_ALBUM_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "hybrid_diary_request.yaml")
DIARY_ALBUM = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_data", "diary_album.yaml")
......@@ -38,7 +49,7 @@ DIARY_ALBUM = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_data
# 日记本列表-日记贴点赞相关()
DIARY_VOTE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "hybrid_api_topic_request.yaml")
DIARY_VOTE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_data", "api_topic_vote.yaml")
DIARY_TOPIC_VOTE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_data", "api_topic_vote.yaml")
# 日记本&帖子&日记贴&帖子&问答各个详情页下方推荐内容
......@@ -472,6 +483,8 @@ CPCCOMMUNITYCLICKLOGS=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_
CPCCATEGORYPROMOTEMANAGELIST=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web2_data", "artemis_cpc_categorypromotemanage_list.yaml")
#医生后台-点点通商品-品类推广管理-新增推广品类
CPCCATEGORYQUERY=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web2_data", "artemis_cpc_category_query.yaml")
#医生后台-点点通商品-品类推广管理-新增推广品类-关联美购
CPCCATEGORYSERVICEIDS=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web2_data", "artemis_cpc_category_service_ids.yaml")
......@@ -544,6 +557,10 @@ CHECK_SKU_IDS = os.path.join(BASE_DIR, "backend_auto/test_om_data/beautycard_dat
CHECK_SPU_IDS_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_om_api", "beautycard_request.yaml")
CHECK_SPU_IDS = os.path.join(BASE_DIR, "backend_auto/test_om_data/beautycard_data", "check_spu_ids.yaml")
#om-achelous
ACHELOUS_REQUEST_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_om_api", "achelous_request.yaml")
#直播-om后台-批量添加美购
BATCH_ADD_SERVICE = os.path.join(BASE_DIR, "backend_auto/test_om_data/achelous_data", "batch_add_service.yaml")
#次卡商详页
BEAUTY_CARD_DETAIL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "beauty_card_detail.yaml")
......
......@@ -13,15 +13,10 @@ class TestDiaryUpdate:
@pytest.mark.parametrize("param", diary_update_data, ids=diary_update_case)
def test_diary_update(self, param):
r = diary_request().diary_update(param["topic_list"])
# print(r)
# if r["error"] == 0:
# assert r["message"] == param["assert"]
if r["error"] == 1:
assert r["message"] == param["message"]
# 校验--如果是因为发布频繁导致的错误就不用理会-如果是其他再判断
# 收藏之后取消收藏?为啥能成功?
......
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.diary_request import diary_request
class TestVote:
data = BaseRequest().api_load(path_setting.DIARY_VOTE)
diary_vote_case, diary_vote_data = get_ids(data, "diary_vote")
@pytest.mark.parametrize("param", diary_vote_data, ids=diary_vote_case)
def test_vote(self, param):
r = diary_request().diary_vote(param["diary_id"])
# 如果点赞成功,就走取消点赞的流程,否则先取消点赞再去点赞
if r["message"] == param["assert2"]:
# 之后取消点赞。【最后保持取消点赞的状态】
cancel_vote = diary_request().diary_cancel_vote(param["diary_id"])
assert cancel_vote["error"] == 0
else:
# 如果是已经点过赞的状态就直接取消点赞,然后再走一遍点赞-取消点赞;一般不走这边除非手动点过这个卡片
assert r["message"] == param["assert3"]
cancel_vote = diary_request().diary_cancel_vote(param["diary_id"])
assert cancel_vote["error"] == 0
vote = diary_request().diary_vote(param["diary_id"])
assert vote["message"] == param["assert2"]
cancel_vote = diary_request().diary_cancel_vote(param["diary_id"])
assert cancel_vote["error"] == 0
......@@ -7,7 +7,7 @@ from all_backend_api.hybrid_api_topic_request import hybrid_api_topic_request
class TestDiaryVote:
data = BaseRequest().api_load(path_setting.DIARY_VOTE)
data = BaseRequest().api_load(path_setting.DIARY_TOPIC_VOTE)
diary_vote_case, diary_vote_data = get_ids(data, "diary_vote")
@pytest.mark.parametrize("param", diary_vote_data, ids=diary_vote_case)
......
import pytest
from ids_list import get_ids
import path_setting
from all_backend_api.janus_request import janus_request
from in_common.base_request import BaseRequest
class TestSalesLeadSpuByDiary:
data = BaseRequest().api_load(path_setting.SPU_BY_DIARY)
sales_lead_spu_by_diary_case, sales_lead_spu_by_diary_data = get_ids(data, "sales_lead_spu_by_diary")
@pytest.mark.parametrize("param",sales_lead_spu_by_diary_data, ids=sales_lead_spu_by_diary_case)
def test_sales_lead_spu_by_diary(self,param):
r = janus_request().sales_lead_spu_by_diary(param["diary_id"])
if r["error"] == 0:
assert r["error"] == param["assert"]
if param["spu_info"] == 1:
assert r["data"]["spu_info"]
else:
assert r["data"]["spu_info"] is None
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.query_request import query_request
class TestPresetWords:
data = BaseRequest().api_load(path_setting.QUERY_PRESET_WORDS)
preset_words_case, preset_words_data = get_ids(data, "preset_words")
@pytest.mark.parametrize("param", preset_words_data, ids=preset_words_case)
def test_PresetWords(self, param):
r = query_request().preset_words(param["id"], param["type"])
# 因问答详情页接口返回不一样所以加了个标示位
key = "is_question_answer"
if param["is_preset_words"] == 1:
assert len(r["data"]["tags"]) == param["len"]
else:
if key in param.keys():
assert len(r["data"]["tags"]) == param["len"]
else:
assert len(r["data"]) == param["len"]
diary_vote:
#点赞case--从日记本卡片对日记本点赞
-
case: "日记本卡片点赞日记本--点赞&取消点赞成功case--校验"
diary_id: 17586091
assert1:
assert2: " +1"
assert3: "已经赞过啦"
diary_vote:
#点赞case--从日记本列表点赞
-
case: "日记本列表点赞--点赞&取消点赞成功case--校验"
case: "日记本列表点赞日记贴--点赞&取消点赞成功case--校验"
id: 21249958
topic_id: 21249958
assert1: 0
......
# 日记本大图关联美购--其实和日记本关联的美购一致
# 用spu_info来作为标示位
# id 是必传项
sales_lead_spu_by_diary:
-
case: "日记本大图关联美购--存在美购"
diary_id: 15261339
spu_info: 1
assert: 0
-
case: "日记本大图关联美购--不存在美购"
diary_id: 17586195
spu_info: null
assert: 0
\ No newline at end of file
preset_words:
#详情页预置词
#is_preset_words 用来case判断有没有预置词,因为两个的判定条件不一样,这样写简单点
# is_question_answer 问答详情页的单独标示位
-
case: "不存在预置词--日记本详情页--校验"
id: 17586091
type: 1
len: 0
is_preset_words: 0
-
case: "存在一个预置词--日记本详情页--校验"
id: 15714021
type: 1
len: 1
is_preset_words: 1
-
case: "存在两个预置词--日记本详情页--校验"
id: 17004877
type: 1
len: 2
is_preset_words: 1
-
case: "不存在预置词--日记贴详情页--校验"
id: 123456954
type: 2
len: 0
is_preset_words: 0
-
case: "存在一个预置词--日记贴详情页--校验"
id: 21129553
type: 2
len: 1
is_preset_words: 1
-
case: "存在两个预置词--日记贴详情页--校验"
id: 21149097
type: 2
len: 2
is_preset_words: 1
-
case: "不存在预置词--问答详情页--校验---单独校验这个返回方式和别的不一样"
id: 357125
type: 3
len: 0
is_preset_words: 0
is_question_answer : 1
-
case: "存在一个预置词--问答详情页--校验"
id: 181212
type: 3
len: 1
is_preset_words: 1
-
case: "存在两个预置词--问答详情页--校验"
id: 124225
type: 3
len: 2
is_preset_words: 1
-
case: "不存在预置词--回答详情页--校验"
id: 1008579
type: 4
len: 0
is_preset_words: 0
-
case: "存在一个预置词--回答详情页--校验"
id: 246245
type: 4
len: 1
is_preset_words: 1
-
case: "存在两个预置词--回答详情页--校验"
id: 867689
type: 4
len: 2
is_preset_words: 1
-
case: "不存在预置词--帖子详情页--校验"
id: 187937
type: 5
len: 0
is_preset_words: 0
-
case: "存在一个预置词--帖子详情页--校验"
id: 44534
type: 5
len: 1
is_preset_words: 1
-
case: "存在两个预置词--帖子详情页--校验"
id: 172774
type: 5
len: 2
is_preset_words: 1
......@@ -3,7 +3,7 @@ reply_create:
beuzhu: '# 备注: 这个文件有冲突的话,那个版本都行不会影响,回退/接受当前版本都行,因为每次运行content都会改变'
case: 日记贴一级评论创建--正常校验&创建二级评论--正常校验
channel: benzhan
content: ces测试+2021-07-28 17:16:20
content: ces测试+2021-07-28 19:16:19
message: 请勿回复重复内容
message1: 回复成功
message2: 你的回复有点频繁,稍后再来
......
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_doctor_api.web2_request import web2_request
class TestArtemisCpcCategoryServiceIds:
data = BaseRequest().api_load(path_setting.CPCCATEGORYSERVICEIDS)
cpccategoryserviceids_case, cpccategoryserviceids_data = get_ids(data, "artemis_cpc_category_service_ids")
@pytest.mark.parametrize("param",cpccategoryserviceids_data,ids=cpccategoryserviceids_case)
def test_artemis_cpc_category_service_ids(self, param):
'''点点通商品-品类推广管理-新增品类推广-关联美购'''
r = web2_request().artemis_cpc_category_service_ids(param["page"], param["pagesize"], param["is_online"], param["category_id"])
print(r)
if r["error"] == 0:
assert r["data"]["services"][0]["is_online"] == param["assert"]
artemis_cpc_category_service_ids:
#点点通商品-品类推广管理
-
case: "点点通商品-品类推广-关联美购-美购状态为已下线"
page: 1
pagesize: 10
is_online: -1
category_id: 8
assert: False
-
case: "点点通商品-品类推广-关联美购-美购状态为已上线"
page: 1
pagesize: 10
is_online: -1
category_id: 22
assert: True
import pytest
import path_setting
from all_om_api.achelous_request import achelous_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
class TestBatchAddService:
data = BaseRequest().api_load(path_setting.BATCH_ADD_SERVICE)
batch_add_service_case, batch_add_service_data = get_ids(data, "batch_add_service")
@pytest.mark.parametrize("param",batch_add_service_data,ids=batch_add_service_case)
def test_batch_add_service(self,param):
r = achelous_request().batch_add_service(param['stream_id'],param['service_item_ids'])
#print(type(r["failed_service_item_ids"]))
if r.get("code") == 1:
assert r['message'] == param["assert"]
elif len(r["failed_service_item_ids"]) == 0:
assert r["success_service_item_ids"] == param["assert2"]
elif r["success_service_item_ids"] == 0:
assert r["success_service_item_ids"] == param["assert1"]
batch_add_service:
-
case: "om-直播-批量添加一件美购"
stream_id: "4166"
service_item_ids: "73809"
assert2: [73809]
-
case: "om-直播-批量添加多件美购"
stream_id: "4166"
service_item_ids: "23508,33823"
assert2: [33823,23508]
-
case: "om-直播添加商品-输入不合法符号"
stream_id: "4166"
service_item_ids: "73809,23508,33823"
assert: "请输入合法的SKU ID以,隔开"
-
case: "om-直播-添加错误美购id"
stream_id: "4166"
service_item_ids: "235"
assert1: '[235]'
\ 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