Commit d747b4ee authored by zhanhuasheng's avatar zhanhuasheng

新增用例

parent ab4d05f6
......@@ -14,21 +14,21 @@ team_room_list_select_result = teamData.team_db.select_many_value(sql=team_room_
team_room_list = tuple(i['room_id'] for i in team_room_list_select_result)
if team_room_list != ():
open_room_select_sql = f'select * from `im_room` where room_id in {team_room_list} and status = 1 and room_type != 2'
open_room_select_sql = f'select * from `im_room` where room_id in {team_room_list} and status = 1 and room_type != 2 and is_ignore = 0'
open_room_select_result = teamData.team_db.select_many_value(sql=open_room_select_sql)
pending_room_select_sql = f'select * from `im_room` where room_id in {team_room_list} and status = 2 and room_type != 2'
pending_room_select_sql = f'select * from `im_room` where room_id in {team_room_list} and status = 2 and room_type != 2 and is_ignore = 0'
pending_room_select_result = teamData.team_db.select_many_value(sql=pending_room_select_sql)
close_room_select_sql = f'select * from `im_room` where room_id in {team_room_list} and status = 3 and room_type != 2'
close_room_select_sql = f'select * from `im_room` where room_id in {team_room_list} and status = 3 and room_type != 2 and is_ignore = 0'
close_room_select_result = teamData.team_db.select_many_value(sql=close_room_select_sql)
setattr(teamData, 'open_room_num', len(open_room_select_result))
setattr(teamData, 'pending_room_num', len(pending_room_select_result))
setattr(teamData, 'close_room_num', len(close_room_select_result))
other_room_select_sql = f'select * from `im_room` where room_id not in {team_room_list} and site_id = {teamData.shopId} and room_type != 2 and status = 1 limit 10'
other_room_select_sql = f'select * from `im_room` where room_id not in {team_room_list} and site_id = {teamData.shopId} and is_ignore = 0 and room_type != 2 and status = 1 limit 10'
else:
setattr(teamData, 'open_room_num', 0)
setattr(teamData, 'pending_room_num', 0)
setattr(teamData, 'close_room_num', 0)
other_room_select_sql = f'select * from `im_room` where `cate_id` = {teamData.brandId} and room_type != 2 and site_id = {teamData.shopId} and status = 1 limit 10'
other_room_select_sql = f'select * from `im_room` where `cate_id` = {teamData.brandId} and room_type != 2 and site_id = {teamData.shopId} and is_ignore = 0 and status = 1 limit 10'
other_room_select_result = teamData.team_db.select_one_value(sql=other_room_select_sql)
setattr(teamData, 'other_room_id', other_room_select_result['room_id'])
......@@ -47,8 +47,9 @@ setattr(teamData, 'team_member_image', team_member_info_select_result['profile']
setattr(teamData, 'team_member_email', team_member_info_select_result['email'])
team_member_open_room_select_sql = f'select * from `im_room` where room_id in {team_room_list} and room_type != 2 and status = 1 and allocation_uid = {team_member_id}'
team_member_open_room_select_sql = f'select * from `im_room` where room_id in {team_room_list} and room_type != 2 and status = 1 and is_ignore = 0 and allocation_uid = {team_member_id}'
team_member_open_room_select_result = teamData.team_db.select_many_value(sql=team_member_open_room_select_sql)
setattr(teamData, 'team_member_open_room_num', len(team_member_open_room_select_result))
teamData.team_db.close_db()
\ No newline at end of file
......@@ -31,13 +31,13 @@ api3:
- eq: {"$.data.articleList[?(@.id==${article_id})].isPublish": "${article_is_publish}" }
- eq: {"$.data.articleList[?(@.id==${article_id})].isPopular": "${article_is_popular}" }
#api4:
# title: 更新文章seo
# url: /api/v1/faq/updateArticleMeta
# method: post
# data: {"id":"${article_id}","metaTitle":"${article_seo_title}","metaDescription":"${article_seo_description}","v":"${v}"}
# expected:
# - eq: {"$.code": 0}
api4:
title: 更新文章seo
url: /api/v1/faq/updateArticleMeta
method: post
data: {"id":"${article_id}","metaTitle":"${article_seo_title}","metaDescription":"${article_seo_description}","v":"${v}"}
expected:
- eq: {"$.code": 0}
api5:
title: 新增文章 - 2
......@@ -85,6 +85,8 @@ api9:
- eq: { "$.data.articleList[?(@.id==${article_id})].content": "${article_new_content}" }
- eq: { "$.data.articleList[?(@.id==${article_id})].isPublish": "${article_new_is_publish}" }
- eq: { "$.data.articleList[?(@.id==${article_id})].isPopular": "${article_new_is_popular}" }
- eq: { "$.data.articleList[?(@.id==${article_id})].metaDescription": "${article_seo_description}" }
- eq: { "$.data.articleList[?(@.id==${article_id})].metaTitle": "${article_seo_title}" }
api10:
title: 删除文章
......
......@@ -4,8 +4,44 @@ api1:
method: post
data: {"uType":2,"platform":1,"v":"${v}"}
before_sql: setting/facebookIntegration/facebookIntegration_select.py
set_value: {"facebook_id": "$.data.data[0].channelId"}
expected:
- eq: {"$.code" : 0}
- in_list: {"$.data.data[*].channelName": "${facebook_name}"}
- exec: {"code": "assert len(res.json()['data']['data']) == ${facebook_num}"}
api2:
title: 关闭消息通知
url: /api/v1/facebook/subscribe
method: post
data: {"channelId":"${facebook_id}","isMessengerEnabled":false,"isInstagramMessengerEnabled":false,"v":"${v}"}
expected:
- eq: {"$.code": 0}
api3:
title: 检查是否关闭通知成功
url: /api/v1/facebook/page
method: post
data: { "uType": 2,"platform": 1,"v": "${v}" }
expected:
- eq: {"$.code": 0}
- eq: {"$.data.data[?(@.channelId == '${facebook_id}')].isMessengerEnabled": false}
- exec: {"code": "assert res.json()['data']['data'][0]['isInstagramMessengerEnabled'] == False if res.json()['data']['data'][0]['instagramUsername'] != '' else res.json()['data']['data'][0]['isInstagramMessengerEnabled'] == True"}
api4:
title: 开启消息通知
url: /api/v1/facebook/subscribe
method: post
data: {"channelId":"${facebook_id}","isMessengerEnabled":true,"isInstagramMessengerEnabled":true,"v":"${v}"}
expected:
- eq: {"$.code": 0}
api5:
title: 是否开启通知成功
url: /api/v1/facebook/page
method: post
data: { "uType": 2,"platform": 1,"v": "${v}" }
expected:
- eq: {"$.code": 0}
- eq: {"$.data.data[?(@.channelId == '${facebook_id}')]['isInstagramMessengerEnabled']": true}
- eq: {"$.data.data[?(@.channelId == '${facebook_id}')].isMessengerEnabled": true}
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