diff --git a/TestCase/setting/test_08_notification.py b/TestCase/setting/test_08_notification.py new file mode 100644 index 0000000000000000000000000000000000000000..ecd83c19e3655f490dd35374f6b8968301370ec1 --- /dev/null +++ b/TestCase/setting/test_08_notification.py @@ -0,0 +1,13 @@ +import pytest +from Utils import yaml_handler +from Utils import req_handler +from TestData.setting.notification_test_data import notifycationData + +class TestNotifycation: + + yaml_path = r'setting/notification.yaml' + yaml_data = yaml_handler.yaml_handler.get_case(yaml_path) + @pytest.mark.flaky(reruns=notifycationData.rerun, reruns_delay=notifycationData.rerun_delay) + @pytest.mark.parametrize('case',yaml_data) + def test_notifycation(self,case): + req_handler.ReqHandler.send_requests(case=case,var_class=notifycationData) diff --git a/TestData/setting/notification_test_data.py b/TestData/setting/notification_test_data.py new file mode 100644 index 0000000000000000000000000000000000000000..94eb282ec27888a515fca5bad62769dd1d76f52d --- /dev/null +++ b/TestData/setting/notification_test_data.py @@ -0,0 +1,5 @@ +from Utils.global_variate import Global + +class notifycationData(Global): + insert_team_name = 'autotest_insert_team' + insert_room_id = 501307576659487524 \ No newline at end of file diff --git a/TestFile/setting/shopifyIntegration/shopifyIntegration_shop_num_select.py b/TestFile/setting/shopifyIntegration/shopifyIntegration_shop_num_select.py new file mode 100644 index 0000000000000000000000000000000000000000..025932a9fa3acb2cbad276fef759a57df417f114 --- /dev/null +++ b/TestFile/setting/shopifyIntegration/shopifyIntegration_shop_num_select.py @@ -0,0 +1,6 @@ +from Utils.sql_handler import test_env_conn +from TestData.setting.shopify_integration_test_data import shopifyIntegrationData +shopify_shop_select_sql = f'select * from `shop` where brand_id = {shopifyIntegrationData.brandId} and source in (1,2) and is_delete in (0,2)' +shopify_shop_select_result = test_env_conn.select_many_value(shopify_shop_select_sql) +shopify_shop_num = len(shopify_shop_select_result) +setattr(shopifyIntegrationData, 'shop_num', shopify_shop_num) \ No newline at end of file diff --git a/YamlCase/account/account.yaml b/YamlCase/account/account.yaml index 71726068abc0e1a7a28e2e91437494a2fb92a442..9a21a545a1d5b57ec6e2fce7f88d7da05463cbae 100644 --- a/YamlCase/account/account.yaml +++ b/YamlCase/account/account.yaml @@ -47,13 +47,13 @@ api6: url: /api/v1/customerService/updateCustomerServiceAccount method: post data: {"id" : "${userId}" , "localLang" : "${target_language}" , "profile" : "${picUrl}", "v" : "${v}"} - after_sql: /account/account_selectLanguage.py expected: - eq: {"$.code" : 0} api7: title: 检查设置语言 url: /api/v1/customerService/getCustomerServiceInfo?v=${v} + before_sql: /account/account_selectLanguage.py method: get expected: - eq: {"$.code": 0 } diff --git a/YamlCase/setting/notification.yaml b/YamlCase/setting/notification.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ff3db82cb44b5f2994e2c8ff8a3da1b47b35d239 --- /dev/null +++ b/YamlCase/setting/notification.yaml @@ -0,0 +1,50 @@ +api1: + title: 关闭所有消息通知 + url: /api/v1/setting/updateShopSetting + method: post + data: {"item":[{"itemId":102,"itemName":"messageNotifyToAll","itemValue":"0","shopId":"0"},{"itemId":103,"itemName":"messageNotifyToTeam","itemValue":"0","shopId":"0"}],"v":"${v}"} + expected: + - eq: {"$.code": 0} + +api2: + title: 检查是否关闭所有消息通知 + url: /api/v1/setting/getShopSetting?v=${v} + method: get + expected: + - eq: {"$.code": 0} + - eq: {"$.data.settingInfoMap.mapList.0.settings[?(@.itemId == 102)].itemValue": "0"} + - eq: {"$.data.settingInfoMap.mapList.0.settings[?(@.itemId == 103)].itemValue": "0"} + +api3: + title: 开启仅针对分配给您的团队的通知 + url: /api/v1/setting/updateShopSetting + method: post + data: {"item":[{"itemId":102,"itemName":"messageNotifyToAll","itemValue":"0","shopId":"0"},{"itemId":103,"itemName":"messageNotifyToTeam","itemValue":"1","shopId":"0"}],"v":"${v}"} + expected: + - eq: {"$.code": 0} + +api4: + title: 检查是否开启仅针对分配给您的团队的通知 + url: /api/v1/setting/getShopSetting?v=${v} + method: get + expected: + - eq: {"$.code": 0} + - eq: {"$.data.settingInfoMap.mapList.0.settings[?(@.itemId == 102)].itemValue": "0"} + - eq: {"$.data.settingInfoMap.mapList.0.settings[?(@.itemId == 103)].itemValue": "1"} + +api5: + title: 开启所有消息通知 + url: /api/v1/setting/updateShopSetting + method: post + data: {"item":[{"itemId":102,"itemName":"messageNotifyToAll","itemValue":"1","shopId":"0"},{"itemId":103,"itemName":"messageNotifyToTeam","itemValue":"0","shopId":"0"}],"v":"${v}"} + expected: + - eq: {"$.code": 0} + +api6: + title: 检查是否开启所有消息通知 + url: /api/v1/setting/getShopSetting?v=${v} + method: get + expected: + - eq: {"$.code": 0} + - eq: {"$.data.settingInfoMap.mapList.0.settings[?(@.itemId == 102)].itemValue": "1"} + - eq: {"$.data.settingInfoMap.mapList.0.settings[?(@.itemId == 103)].itemValue": "0"}