From d747b4ee1be4e716ed551bb9766e6da532c698e6 Mon Sep 17 00:00:00 2001 From: zhanhuasheng Date: Mon, 27 May 2024 17:01:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TestFile/inbox/team_select.py | 13 ++++---- YamlCase/FAQ/article_opreate.yaml | 16 +++++----- YamlCase/setting/facebookIntegration.yaml | 36 +++++++++++++++++++++++ 3 files changed, 52 insertions(+), 13 deletions(-) diff --git a/TestFile/inbox/team_select.py b/TestFile/inbox/team_select.py index 0379093..65d2ae4 100644 --- a/TestFile/inbox/team_select.py +++ b/TestFile/inbox/team_select.py @@ -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 diff --git a/YamlCase/FAQ/article_opreate.yaml b/YamlCase/FAQ/article_opreate.yaml index bcf80ed..6676f64 100644 --- a/YamlCase/FAQ/article_opreate.yaml +++ b/YamlCase/FAQ/article_opreate.yaml @@ -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: 删除文章 diff --git a/YamlCase/setting/facebookIntegration.yaml b/YamlCase/setting/facebookIntegration.yaml index 8fc7ad0..8eb945e 100644 --- a/YamlCase/setting/facebookIntegration.yaml +++ b/YamlCase/setting/facebookIntegration.yaml @@ -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} -- GitLab