From 0f5fbd61d1721c517db42fd23a5175c6aef185af Mon Sep 17 00:00:00 2001 From: zhanhuasheng Date: Mon, 15 Apr 2024 17:47:32 +0800 Subject: [PATCH] =?UTF-8?q?bugfix=20=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 --- ..._01_article.py => test_01_article_info.py} | 6 +- TestCase/FAQ/test_02_article_opreate.py | 13 ++ TestCase/FAQ/test_03_article_page_setting.py | 13 ++ TestCase/report/test_01_report.py | 13 ++ ...test_data.py => article_info_test_data.py} | 2 +- TestData/FAQ/article_opreate_test_data.py | 21 ++++ .../FAQ/article_page_setting_test_data.py | 48 ++++++++ TestData/report/report_test_data.py | 4 + TestFile/FAQ/article_list_select.py | 40 +++---- TestFile/FAQ/article_opreate_select.py | 14 +++ TestFile/FAQ/article_url_update.py | 8 +- TestFile/FAQ/popular_article_update.py | 4 +- Utils/req_handler.py | 13 +- .../FAQ/{article.yaml => article_info.yaml} | 0 YamlCase/FAQ/article_opreate.yaml | 112 ++++++++++++++++++ YamlCase/FAQ/article_page_setting.yaml | 70 +++++++++++ YamlCase/account/account.yaml | 1 - YamlCase/inbox/ticketStatus.yaml | 2 +- YamlCase/report/report.yaml | 15 +++ conftest.py | 1 + 20 files changed, 363 insertions(+), 37 deletions(-) rename TestCase/FAQ/{test_01_article.py => test_01_article_info.py} (66%) create mode 100644 TestCase/FAQ/test_02_article_opreate.py create mode 100644 TestCase/FAQ/test_03_article_page_setting.py create mode 100644 TestCase/report/test_01_report.py rename TestData/FAQ/{faq_test_data.py => article_info_test_data.py} (59%) create mode 100644 TestData/FAQ/article_opreate_test_data.py create mode 100644 TestData/FAQ/article_page_setting_test_data.py create mode 100644 TestData/report/report_test_data.py create mode 100644 TestFile/FAQ/article_opreate_select.py rename YamlCase/FAQ/{article.yaml => article_info.yaml} (100%) create mode 100644 YamlCase/FAQ/article_opreate.yaml create mode 100644 YamlCase/FAQ/article_page_setting.yaml create mode 100644 YamlCase/report/report.yaml diff --git a/TestCase/FAQ/test_01_article.py b/TestCase/FAQ/test_01_article_info.py similarity index 66% rename from TestCase/FAQ/test_01_article.py rename to TestCase/FAQ/test_01_article_info.py index 4e35d65..d65f7da 100644 --- a/TestCase/FAQ/test_01_article.py +++ b/TestCase/FAQ/test_01_article_info.py @@ -1,13 +1,13 @@ import pytest from Utils import yaml_handler from Utils import req_handler -from TestData.FAQ.faq_test_data import faqData +from TestData.FAQ.article_info_test_data import articleInfoTestData class TestFAQ: - yaml_path = r'FAQ\article.yaml' + yaml_path = r'FAQ\article_info.yaml' yaml_data = yaml_handler.yaml_handler.get_case(yaml_path) @pytest.mark.parametrize('case',yaml_data) def test_article(self,case): - req_handler.ReqHandler.send_requests(case=case,var_class=faqData) + req_handler.ReqHandler.send_requests(case=case,var_class=articleInfoTestData) print(case) \ No newline at end of file diff --git a/TestCase/FAQ/test_02_article_opreate.py b/TestCase/FAQ/test_02_article_opreate.py new file mode 100644 index 0000000..5cae771 --- /dev/null +++ b/TestCase/FAQ/test_02_article_opreate.py @@ -0,0 +1,13 @@ +import pytest +from Utils import yaml_handler +from Utils import req_handler +from TestData.FAQ.article_opreate_test_data import articleOperateTestData + +class TestArticleOpreate: + + yaml_path = r'FAQ\article_opreate.yaml' + yaml_data = yaml_handler.yaml_handler.get_case(yaml_path) + @pytest.mark.parametrize('case',yaml_data) + def test_article_opreate(self,case): + req_handler.ReqHandler.send_requests(case=case,var_class=articleOperateTestData) + print(case) \ No newline at end of file diff --git a/TestCase/FAQ/test_03_article_page_setting.py b/TestCase/FAQ/test_03_article_page_setting.py new file mode 100644 index 0000000..582059a --- /dev/null +++ b/TestCase/FAQ/test_03_article_page_setting.py @@ -0,0 +1,13 @@ +import pytest +from Utils import yaml_handler +from Utils import req_handler +from TestData.FAQ.article_page_setting_test_data import articlePageSettingTestData + +class TestArticleOpreate: + + yaml_path = r'FAQ\article_page_setting.yaml' + yaml_data = yaml_handler.yaml_handler.get_case(yaml_path) + @pytest.mark.parametrize('case',yaml_data) + def test_article_page_setting(self,case): + req_handler.ReqHandler.send_requests(case=case,var_class=articlePageSettingTestData) + print(case) \ No newline at end of file diff --git a/TestCase/report/test_01_report.py b/TestCase/report/test_01_report.py new file mode 100644 index 0000000..91d8fb4 --- /dev/null +++ b/TestCase/report/test_01_report.py @@ -0,0 +1,13 @@ +import pytest +from Utils import yaml_handler +from Utils import req_handler +from TestData.report.report_test_data import reportData + +class TestReport: + + yaml_path = r'report/report.yaml' + yaml_data = yaml_handler.yaml_handler.get_case(yaml_path) + @pytest.mark.parametrize('case',yaml_data) + def test_report(self,case): + req_handler.ReqHandler.send_requests(case=case,var_class=reportData) + print(case) \ No newline at end of file diff --git a/TestData/FAQ/faq_test_data.py b/TestData/FAQ/article_info_test_data.py similarity index 59% rename from TestData/FAQ/faq_test_data.py rename to TestData/FAQ/article_info_test_data.py index 358d706..891ea80 100644 --- a/TestData/FAQ/faq_test_data.py +++ b/TestData/FAQ/article_info_test_data.py @@ -1,6 +1,6 @@ from Utils.global_variate import Global -class faqData(Global): +class articleInfoTestData(Global): pass diff --git a/TestData/FAQ/article_opreate_test_data.py b/TestData/FAQ/article_opreate_test_data.py new file mode 100644 index 0000000..a9409f7 --- /dev/null +++ b/TestData/FAQ/article_opreate_test_data.py @@ -0,0 +1,21 @@ +from Utils.global_variate import Global + +class articleOperateTestData(Global): + category_name = 'autotest_category_name' + category_description = 'autotest_category_description' + category_icon = 'people_community' + article_name = 'autotest_article_name' + article_content = '

autotest article content

"' + article_keyword = 'autotest_article_content' + article_is_popular = 1 + article_is_publish = 1 + article_seo_title = 'autotest_article_seo_title' + article_seo_description = 'autotest_article_seo_description' + article_new_name = 'autotest_article_new_name' + article_new_content = '

autotest article new content

"' + article_new_keyword = 'autotest_article_new_content' + article_new_is_popular = 2 + article_new_is_publish = 2 + category_new_icon = 'people_twousers' + category_new_description = 'autotest_category_new_description' + category_new_name = 'autotest_category_new_name' \ No newline at end of file diff --git a/TestData/FAQ/article_page_setting_test_data.py b/TestData/FAQ/article_page_setting_test_data.py new file mode 100644 index 0000000..c2f357e --- /dev/null +++ b/TestData/FAQ/article_page_setting_test_data.py @@ -0,0 +1,48 @@ +from Utils.global_variate import Global + +class articlePageSettingTestData(Global): + newFont = 'Anton' + oldFont = 'Inter' + newStyle = "0" + oldStyle = "1" + newTitle = 'autotest_page_title' + oldTitle = 'Welcome to help center' + newTitleColor = '#4A4A4A' + oldTitleColor = '#FFFFFF' + newActionColor = '#221AD4' + oldActionColor = '#2C23E5' + newLogoColor = '#1C15C1' + oldLogoColor = '#160FA9' + newBackgroundColor = '#FFFFFA' + oldBackgroundColor = '#FFFFFF' + newTypeFontColor = '#000001' + oldTypeFontColor = '#000000' + newDisplayContactUs = '0' + oldDisplayContactUs = '1' + newFacebookSwitch = '0' + oldFacebookSwitch = '1' + newInsSwitch = '0' + oldInsSwitch = '1' + newTwitterSwitch = '0' + oldTwitterSwitch = '1' + oldFacebookLink = 'https://www.facebook_autotest.com' + oldInsLink = 'https://www.instagram_autotest.com' + oldTwitterLink = 'https://www.twitter_autotest.com' + newTranslateLanguage = 'English' + oldTranslateLanguage = 'Chinese (Simplified)' + newSearchKeyword = 'Search for support' + oldSearchKeyword = '搜索支持' + newSpecialArticleKeyword = 'Featured Articles' + oldSpecialArticleKeyword = '特色文章' + newTypeKeyword = 'Category' + oldTypeKeyword = '类别' + newFankuiKeyword = 'Did this answer your questions?' + oldFankuiKeyword = '这回答了你的问题吗?' + newContactUsTitleKeyword = 'Contact us' + oldContactUsTitleKeyword = '联系我们' + NewContactUsContentKeyword = 'Chat or email us' + oldContactUsContentKeyword = '聊天或发邮件给我们' + newChatButtonKeyword = 'Chat with us' + oldChatButtonKeyword = '与我们聊天' + newEmailButtonKeyword = 'Email us' + oldEmailButtonKeyword = '给我们发电子邮件' \ No newline at end of file diff --git a/TestData/report/report_test_data.py b/TestData/report/report_test_data.py new file mode 100644 index 0000000..946cc5a --- /dev/null +++ b/TestData/report/report_test_data.py @@ -0,0 +1,4 @@ +from Utils.global_variate import Global + +class reportData(Global): + pass \ No newline at end of file diff --git a/TestFile/FAQ/article_list_select.py b/TestFile/FAQ/article_list_select.py index 4ca2871..f2459cc 100644 --- a/TestFile/FAQ/article_list_select.py +++ b/TestFile/FAQ/article_list_select.py @@ -1,14 +1,14 @@ from Utils.sql_handler import test_env_conn -from TestData.FAQ.faq_test_data import faqData +from TestData.FAQ.article_info_test_data import articleInfoTestData -all_article_list_select_sql = f'select * from `article` where brand_id = {faqData.brandId} and is_delete = 0' +all_article_list_select_sql = f'select * from `article` where brand_id = {articleInfoTestData.brandId} and is_delete = 0' all_article_list_select_result = test_env_conn.select_many_value(all_article_list_select_sql) all_article_num = len(all_article_list_select_result) -shop_article_list_select_sql = f'select * from `article` where brand_id = {faqData.brandId} and shop_id = {faqData.shopId} and is_delete = 0' +shop_article_list_select_sql = f'select * from `article` where brand_id = {articleInfoTestData.brandId} and shop_id = {articleInfoTestData.shopId} and is_delete = 0' shop_article_list_select_result = test_env_conn.select_many_value(shop_article_list_select_sql) shop_article_num = len(shop_article_list_select_result) -setattr(faqData,'all_article_num',all_article_num) -setattr(faqData,'shop_article_num',shop_article_num) +setattr(articleInfoTestData,'all_article_num',all_article_num) +setattr(articleInfoTestData,'shop_article_num',shop_article_num) article = shop_article_list_select_result[0] article_id = article['id'] article_category_id = article['article_category_id'] @@ -25,19 +25,19 @@ article_meta_description = article['meta_description'] if article['meta_descript article_view_count = article['views'] article_evaluate_good = article['article_evaluate_good'] article_evaluate_bad = article['article_evaluate_bad'] -setattr(faqData,'article_id',article_id) -setattr(faqData,'article_category_id',article_category_id) -setattr(faqData,'article_title',article_title) -setattr(faqData,'article_sort',article_sort) -setattr(faqData,'article_content',article_content) -setattr(faqData,'article_is_published',article_is_published) -setattr(faqData,'article_is_popular',article_is_popular) -setattr(faqData,'article_meta_title',article_meta_title) -setattr(faqData,'article_meta_description',article_meta_description) -setattr(faqData,'article_view_count',article_view_count) -setattr(faqData,'article_view_count_add',article_view_count + 1) -setattr(faqData,'article_evaluate_good',article_evaluate_good) -setattr(faqData,'article_evaluate_good_add',article_evaluate_good + 1) -setattr(faqData,'article_evaluate_bad',article_evaluate_bad) -setattr(faqData,'article_evaluate_bad_add',article_evaluate_bad + 1) +setattr(articleInfoTestData,'article_id',article_id) +setattr(articleInfoTestData,'article_category_id',article_category_id) +setattr(articleInfoTestData,'article_title',article_title) +setattr(articleInfoTestData,'article_sort',article_sort) +setattr(articleInfoTestData,'article_content',article_content) +setattr(articleInfoTestData,'article_is_published',article_is_published) +setattr(articleInfoTestData,'article_is_popular',article_is_popular) +setattr(articleInfoTestData,'article_meta_title',article_meta_title) +setattr(articleInfoTestData,'article_meta_description',article_meta_description) +setattr(articleInfoTestData,'article_view_count',article_view_count) +setattr(articleInfoTestData,'article_view_count_add',article_view_count + 1) +setattr(articleInfoTestData,'article_evaluate_good',article_evaluate_good) +setattr(articleInfoTestData,'article_evaluate_good_add',article_evaluate_good + 1) +setattr(articleInfoTestData,'article_evaluate_bad',article_evaluate_bad) +setattr(articleInfoTestData,'article_evaluate_bad_add',article_evaluate_bad + 1) diff --git a/TestFile/FAQ/article_opreate_select.py b/TestFile/FAQ/article_opreate_select.py new file mode 100644 index 0000000..a97f3b9 --- /dev/null +++ b/TestFile/FAQ/article_opreate_select.py @@ -0,0 +1,14 @@ +from Utils.sql_handler import test_env_conn +from TestData.FAQ.article_opreate_test_data import articleOperateTestData + +category_id_select_sql = f"select * from `article_categorie` where brand_id = {articleOperateTestData.brandId} and shop_id = {articleOperateTestData.shopId} and category_name = '{articleOperateTestData.category_name}'" + +category_id_select_result = test_env_conn.select_one_value(sql=category_id_select_sql) + +if category_id_select_result: + pass +else: + category_insert_sql = f"""INSERT INTO `article_categorie` + (brand_id,shop_id,category_name,category_level,category_sort,is_publish,is_popular,popular_at,is_delete,icon_type,is_checkout,is_enable_icon,description,category_icon,system_id,create_at,update_at) + VALUES ({articleOperateTestData.brandId},{articleOperateTestData.shopId},'{articleOperateTestData.category_name}','',1,1,1,NULL,0,0,'','','{articleOperateTestData.category_description}','{articleOperateTestData.category_icon}',0,'2024-02-19 16:43:20','2024-04-02 12:01:07');""" + test_env_conn.execute_sql(category_insert_sql) diff --git a/TestFile/FAQ/article_url_update.py b/TestFile/FAQ/article_url_update.py index 3e14298..4e6a4c8 100644 --- a/TestFile/FAQ/article_url_update.py +++ b/TestFile/FAQ/article_url_update.py @@ -1,7 +1,7 @@ from Utils.sql_handler import test_env_conn -from TestData.FAQ.faq_test_data import faqData +from TestData.FAQ.article_info_test_data import articleInfoTestData -url = faqData.faqUrl -url = url.replace('helpPath=/',f'helpPath=/article/wquery/{faqData.article_title}') -setattr(faqData,'faqUrl',url) \ No newline at end of file +url = articleInfoTestData.faqUrl +url = url.replace('helpPath=/',f'helpPath=/article/wquery/{articleInfoTestData.article_title}') +setattr(articleInfoTestData,'faqUrl',url) \ No newline at end of file diff --git a/TestFile/FAQ/popular_article_update.py b/TestFile/FAQ/popular_article_update.py index 09c616f..0ca43f5 100644 --- a/TestFile/FAQ/popular_article_update.py +++ b/TestFile/FAQ/popular_article_update.py @@ -1,5 +1,5 @@ from Utils.sql_handler import test_env_conn -from TestData.FAQ.faq_test_data import faqData +from TestData.FAQ.article_info_test_data import articleInfoTestData -popular_article_update_sql = f'update `article` set is_popular = 0 where brand_id = {faqData.brandId} and shop_id = {faqData.shopId} and is_popular = 1' +popular_article_update_sql = f'update `article` set is_popular = 0 where brand_id = {articleInfoTestData.brandId} and shop_id = {articleInfoTestData.shopId} and is_popular = 1' test_env_conn.execute_sql(sql=popular_article_update_sql) diff --git a/Utils/req_handler.py b/Utils/req_handler.py index 595f7fd..5fab85b 100644 --- a/Utils/req_handler.py +++ b/Utils/req_handler.py @@ -141,7 +141,10 @@ class ReqHandler: assert_way = item_key path = list(item_value.keys())[0] #拿到path路径 value = list(item_value.values())[0] - res_path_value = jsonpath.jsonpath(res.json(),path)[0] if str(path)[0:2] == '$.' else path + if 'in_list' not in assert_way: + res_path_value = jsonpath.jsonpath(res.json(),path)[0] if str(path)[0:2] == '$.' else path + else: + res_path_value = jsonpath.jsonpath(res.json(),path) if isinstance(res_path_value,str) and '{"contentList":' in res_path_value: res_path_value = res_path_value.replace('\\','') #兼容websocket,当遇到包含{"contentList":内容的值,且类型是字符串时,会自动去除所有\号 if assert_way == 'eq': #eq代表完全相同 @@ -152,13 +155,13 @@ class ReqHandler: assert value != res_path_value elif assert_way == 'almost': #almonst代表四舍五入后相同就判断为一致 assert round(value,2) == round(res_path_value,2) - elif assert_way == 'in': #in代表断言值在返回值中 + elif assert_way in ['in','in_list']: #in代表断言值在返回值中 assert value in res_path_value - elif assert_way == 'ain':#ain代表返回值在断言值中 + elif assert_way in ['ain','ain_list']:#ain代表返回值在断言值中 assert res_path_value in value - elif assert_way == 'not_in': + elif assert_way in ['not_in','not_in_list']: assert value not in res_path_value - elif assert_way == 'a_not_in': + elif assert_way in ['a_not_in','a_not_in_list']: assert res_path_value not in value elif assert_way == 'exec': exec(value) diff --git a/YamlCase/FAQ/article.yaml b/YamlCase/FAQ/article_info.yaml similarity index 100% rename from YamlCase/FAQ/article.yaml rename to YamlCase/FAQ/article_info.yaml diff --git a/YamlCase/FAQ/article_opreate.yaml b/YamlCase/FAQ/article_opreate.yaml new file mode 100644 index 0000000..bcf80ed --- /dev/null +++ b/YamlCase/FAQ/article_opreate.yaml @@ -0,0 +1,112 @@ +api1: + title: 新增分类 + url: /api/v1/faq/addCategory + method: post + data: {"categoryName":"${category_name}","shopId":"${shopId}","description":"${category_description}","categoryIcon":"${category_icon}","v":"${v}"} + set_value: {"category_id" : "$.data.id"} + expected: + - eq: {"$.code": 0} + +api2: + title: 新增文章 + url: /api/v1/faq/addArticle + method: post + data: {"shopId":"${shopId}","articleCategoryId":"${category_id}","title":"${article_name}","content":"${article_content}","articleKeywords":"${article_keyword}","isPublish":"${article_is_publish}","isPopular":"${article_is_popular}","v":"${v}"} + before_sql: FAQ/article_opreate_select.py + set_value: {"article_id" : "$.data.id"} + expected: + - eq: {"$.code": 0} + +api3: + title: 检查是否新增分类、文章成功 + url: /api/v1/helpcenter/buser/GetFaqList?v=${v} + method: get + expected: + - eq: {"$.code": 0} + - eq: {"$.data.categoryList[?(@.id==${category_id})].categoryName" : "${category_name}"} + - eq: {"$.data.categoryList[?(@.id==${category_id})].categoryIcon" : "${category_icon}"} + - eq: {"$.data.categoryList[?(@.id==${category_id})].description" : "${category_description}"} + - eq: {"$.data.articleList[?(@.id==${article_id})].title": "${article_name}" } + - eq: {"$.data.articleList[?(@.id==${article_id})].content": "${article_content}" } + - 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} + +api5: + title: 新增文章 - 2 + url: /api/v1/faq/addArticle + method: post + data: {"shopId":"${shopId}","articleCategoryId":"${category_id}","title":"${article_name}","content":"${article_content}","articleKeywords":"${article_keyword}","isPublish":"${article_is_publish}","isPopular":"${article_is_popular}","v":"${v}"} + set_value: {"article_id2" : "$.data.id"} + expected: + - eq: {"$.code": 0} + +api6: + title: 更新文章排序 + url: /api/v1/faq/updateSort + method: post + data: {"mark":"article","sortData":[{"id":"${article_id2}","sort":2},{"id":"${article_id}","sort":1}],"v":"${v}"} + expected: + - eq: {"$.code": 0} + +api7: + title: 更新文章内容 + url: /api/v1/faq/updateArticle + method: post + data: {"shopId":"${shopId}","id":"${article_id}","articleCategoryId":"${category_id}","title":"${article_new_name}","content":"${article_new_content}","articleKeywords":"${article_new_keyword}","isPublish":"${article_new_is_publish}","isPopular":"${article_new_is_popular}","articleSort":1,"v":"${v}"} + expected: + - eq: {"$.code": 0} + +api8: + title: 更新分类内容 + url: /api/v1/faq/updateCategory + method: post + data: {"id":"${category_id}","categoryName":"${category_new_name}","shopId":"${shopId}","description":"${category_new_description}","categoryIcon":"${category_new_icon}","setDescription":true,"setCategoryIcon":true,"v":"${v}"} + expected: + - eq: {"$.code": 0} + +api9: + title: 检查文章、分类是否更新成功 + url: /api/v1/helpcenter/buser/GetFaqList?v=${v} + method: get + expected: + - eq: {"$.code": 0} + - eq: { "$.data.categoryList[?(@.id==${category_id})].categoryName": "${category_new_name}" } + - eq: { "$.data.categoryList[?(@.id==${category_id})].categoryIcon": "${category_new_icon}" } + - eq: { "$.data.categoryList[?(@.id==${category_id})].description": "${category_new_description}" } + - eq: { "$.data.articleList[?(@.id==${article_id})].title": "${article_new_name}" } + - 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}" } + +api10: + title: 删除文章 + url: /api/v1/faq/deleteArticle + method: post + data: {"id":"${article_id}","v":"${v}"} + expected: + - eq: {"$.code": 0} + +api11: + title: 删除分类 + url: /api/v1/faq/deleteCategory + method: post + data: {"id":"${category_id}","v":"${v}"} + expected: + - eq: {"$.code": 0} + +api12: + title: 检查是否删除成功 + url: /api/v1/helpcenter/buser/GetFaqList?v=${v} + method: get + expected: + - eq: {"$.code": 0} + - not_in_list: {"$.data.categoryList[*].id": "${category_id}"} + - not_in_list: {"$.data.articleList[*].id": "${article_id}"} diff --git a/YamlCase/FAQ/article_page_setting.yaml b/YamlCase/FAQ/article_page_setting.yaml new file mode 100644 index 0000000..04e8a6e --- /dev/null +++ b/YamlCase/FAQ/article_page_setting.yaml @@ -0,0 +1,70 @@ +api1: + title: 更改FAQ页面设置 + url: /api/v1/setting/updateShopSetting + method: post + data: {"item":[{"shopId":"7238","itemId":85,"itemValue":"${newFont}","itemName":"centerFontFamily"},{"shopId":"7238","itemId":84,"itemValue":"${newStyle}","itemName":"centerChooseTheme"},{"shopId":"7238","itemId":1,"itemValue":"${newTitle}","itemName":"centerThemeTitle"},{"shopId":"7238","itemId":128,"itemValue":"${newTitleColor}","itemName":"bannerCenterThemeTitleColor"},{"shopId":"7238","itemId":88,"itemValue":"${newActionColor}","itemName":"centerCategoryNavStateColor"},{"shopId":"7238","itemId":132,"itemValue":"${newLogoColor}","itemName":"bannerCategoryIconColor"},{"shopId":"7238","itemId":133,"itemValue":"${newBackgroundColor}","itemName":"bannerPageBackground"},{"shopId":"7238","itemId":134,"itemValue":"${newTypeFontColor}","itemName":"bannerCenterCategoryTextColor"},{"shopId":"7238","itemId":141,"itemValue":"${newDisplayContactUs}","itemName":"displayContactusSwitch"},{"shopId":"7238","itemId":144,"itemValue":"${newFacebookSwitch}","itemName":"facebookMediaCheck"},{"shopId":"7238","itemId":146,"itemValue":"${newInsSwitch}","itemName":"instagramMediaCheck"},{"shopId":"7238","itemId":148,"itemValue":"${newTwitterSwitch}","itemName":"twitterMediaCheck"},{"shopId":"7238","itemId":150,"itemValue":"${newTranslateLanguage}","itemName":"helpcenterLanguage"},{"shopId":"7238","itemId":151,"itemValue":"${newSearchKeyword}","itemName":"searchSupport"},{"shopId":"7238","itemId":152,"itemValue":"${newSpecialArticleKeyword}","itemName":"frequentlyReadarticles"},{"shopId":"7238","itemId":167,"itemValue":"${newTypeKeyword}","itemName":"relatedCategory"},{"shopId":"7238","itemId":173,"itemValue":"${newFankuiKeyword}","itemName":"feedbackDescription"},{"shopId":"7238","itemId":156,"itemValue":"${NewContactUsContentKeyword}","itemName":"contactusDescription"},{"shopId":"7238","itemId":157,"itemValue":"${newChatButtonKeyword}","itemName":"chatButtonText"},{"shopId":"7238","itemId":158,"itemValue":"${newEmailButtonKeyword}","itemName":"emailusButtonText"}],"v":"202404121750"} + expected: + - eq: {"$.code" : 0} + +api2: + title: 检查FAQ页面设置是否更改成功 + url: /api/v1/setting/getCShopSetting?domain=${shopDomain} + method: get + expected: + - eq: {"$.code" : 0} + - eq: {"$.data.settingInfo[?(@.itemId == 85)].itemValue" : "${newFont}"} + - eq: {"$.data.settingInfo[?(@.itemId == 84)].itemValue" : "${newStyle}"} + - eq: {"$.data.settingInfo[?(@.itemId == 1)].itemValue" : "${newTitle}"} + - eq: {"$.data.settingInfo[?(@.itemId == 128)].itemValue" : "${newTitleColor}"} + - eq: {"$.data.settingInfo[?(@.itemId == 88)].itemValue" : "${newActionColor}"} + - eq: {"$.data.settingInfo[?(@.itemId == 132)].itemValue" : "${newLogoColor}"} + - eq: {"$.data.settingInfo[?(@.itemId == 133)].itemValue" : "${newBackgroundColor}"} + - eq: {"$.data.settingInfo[?(@.itemId == 134)].itemValue" : "${newTypeFontColor}"} + - eq: {"$.data.settingInfo[?(@.itemId == 141)].itemValue" : "${newDisplayContactUs}"} + - eq: {"$.data.settingInfo[?(@.itemId == 144)].itemValue" : "${newFacebookSwitch}"} + - eq: {"$.data.settingInfo[?(@.itemId == 146)].itemValue" : "${newInsSwitch}"} + - eq: {"$.data.settingInfo[?(@.itemId == 148)].itemValue" : "${newTwitterSwitch}"} + - eq: {"$.data.settingInfo[?(@.itemId == 150)].itemValue" : "${newTranslateLanguage}"} + - eq: {"$.data.settingInfo[?(@.itemId == 151)].itemValue" : "${newSearchKeyword}"} + - eq: {"$.data.settingInfo[?(@.itemId == 152)].itemValue" : "${newSpecialArticleKeyword}"} + - eq: {"$.data.settingInfo[?(@.itemId == 167)].itemValue" : "${newTypeKeyword}"} + - eq: {"$.data.settingInfo[?(@.itemId == 173)].itemValue" : "${newFankuiKeyword}"} + - eq: {"$.data.settingInfo[?(@.itemId == 156)].itemValue" : "${NewContactUsContentKeyword}"} + - eq: {"$.data.settingInfo[?(@.itemId == 157)].itemValue" : "${newChatButtonKeyword}"} + - eq: {"$.data.settingInfo[?(@.itemId == 158)].itemValue" : "${newEmailButtonKeyword}"} + +api3: + title: 还原FAQ页面设置 + url: /api/v1/setting/updateShopSetting + method: post + data: {"item":[{"shopId":"7238","itemId":85,"itemValue":"${oldFont}","itemName":"centerFontFamily"},{"shopId":"7238","itemId":84,"itemValue":"${oldStyle}","itemName":"centerChooseTheme"},{"shopId":"7238","itemId":1,"itemValue":"${oldTitle}","itemName":"centerThemeTitle"},{"shopId":"7238","itemId":128,"itemValue":"${oldTitleColor}","itemName":"bannerCenterThemeTitleColor"},{"shopId":"7238","itemId":88,"itemValue":"${oldActionColor}","itemName":"centerCategoryNavStateColor"},{"shopId":"7238","itemId":132,"itemValue":"${oldLogoColor}","itemName":"bannerCategoryIconColor"},{"shopId":"7238","itemId":133,"itemValue":"${oldBackgroundColor}","itemName":"bannerPageBackground"},{"shopId":"7238","itemId":134,"itemValue":"${oldTypeFontColor}","itemName":"bannerCenterCategoryTextColor"},{"shopId":"7238","itemId":141,"itemValue":"${oldDisplayContactUs}","itemName":"displayContactusSwitch"},{"shopId":"7238","itemId":144,"itemValue":"${oldFacebookSwitch}","itemName":"facebookMediaCheck"},{"shopId":"7238","itemId":146,"itemValue":"${oldInsSwitch}","itemName":"instagramMediaCheck"},{"shopId":"7238","itemId":148,"itemValue":"${oldTwitterSwitch}","itemName":"twitterMediaCheck"},{"shopId":"7238","itemId":150,"itemValue":"${oldTranslateLanguage}","itemName":"helpcenterLanguage"},{"shopId":"7238","itemId":151,"itemValue":"${oldSearchKeyword}","itemName":"searchSupport"},{"shopId":"7238","itemId":152,"itemValue":"${oldSpecialArticleKeyword}","itemName":"frequentlyReadarticles"},{"shopId":"7238","itemId":167,"itemValue":"${oldTypeKeyword}","itemName":"relatedCategory"},{"shopId":"7238","itemId":173,"itemValue":"${oldFankuiKeyword}","itemName":"feedbackDescription"},{"shopId":"7238","itemId":156,"itemValue":"${oldContactUsContentKeyword}","itemName":"contactusDescription"},{"shopId":"7238","itemId":157,"itemValue":"${oldChatButtonKeyword}","itemName":"chatButtonText"},{"shopId":"7238","itemId":158,"itemValue":"${oldEmailButtonKeyword}","itemName":"emailusButtonText"}],"v":"202404121750"} + expected: + - eq: {"$.code" : 0} + +api4: + title: 检查FAQ页面设置是否还原成功 + url: /api/v1/setting/getCShopSetting?domain=${shopDomain} + method: get + expected: + - eq: {"$.code" : 0} + - eq: {"$.data.settingInfo[?(@.itemId == 85)].itemValue" : "${oldFont}"} + - eq: {"$.data.settingInfo[?(@.itemId == 84)].itemValue" : "${oldStyle}"} + - eq: {"$.data.settingInfo[?(@.itemId == 1)].itemValue" : "${oldTitle}"} + - eq: {"$.data.settingInfo[?(@.itemId == 128)].itemValue" : "${oldTitleColor}"} + - eq: {"$.data.settingInfo[?(@.itemId == 88)].itemValue" : "${oldActionColor}"} + - eq: {"$.data.settingInfo[?(@.itemId == 132)].itemValue" : "${oldLogoColor}"} + - eq: {"$.data.settingInfo[?(@.itemId == 133)].itemValue" : "${oldBackgroundColor}"} + - eq: {"$.data.settingInfo[?(@.itemId == 134)].itemValue" : "${oldTypeFontColor}"} + - eq: {"$.data.settingInfo[?(@.itemId == 141)].itemValue" : "${oldDisplayContactUs}"} + - eq: {"$.data.settingInfo[?(@.itemId == 144)].itemValue" : "${oldFacebookSwitch}"} + - eq: {"$.data.settingInfo[?(@.itemId == 146)].itemValue" : "${oldInsSwitch}"} + - eq: {"$.data.settingInfo[?(@.itemId == 148)].itemValue" : "${oldTwitterSwitch}"} + - eq: {"$.data.settingInfo[?(@.itemId == 150)].itemValue" : "${oldTranslateLanguage}"} + - eq: {"$.data.settingInfo[?(@.itemId == 151)].itemValue" : "${oldSearchKeyword}"} + - eq: {"$.data.settingInfo[?(@.itemId == 152)].itemValue" : "${oldSpecialArticleKeyword}"} + - eq: {"$.data.settingInfo[?(@.itemId == 167)].itemValue" : "${oldTypeKeyword}"} + - eq: {"$.data.settingInfo[?(@.itemId == 173)].itemValue" : "${oldFankuiKeyword}"} + - eq: {"$.data.settingInfo[?(@.itemId == 156)].itemValue" : "${oldContactUsContentKeyword}"} + - eq: {"$.data.settingInfo[?(@.itemId == 157)].itemValue" : "${oldChatButtonKeyword}"} + - eq: {"$.data.settingInfo[?(@.itemId == 158)].itemValue" : "${oldEmailButtonKeyword}"} + diff --git a/YamlCase/account/account.yaml b/YamlCase/account/account.yaml index bcd98bd..7b85d55 100644 --- a/YamlCase/account/account.yaml +++ b/YamlCase/account/account.yaml @@ -50,7 +50,6 @@ api6: after_sql: /account/account_selectLanguage.py expected: - eq: {"$.code" : 0} - - eq: {"$.msg" : "success"} api8: title: 检查翻译文本接口 diff --git a/YamlCase/inbox/ticketStatus.yaml b/YamlCase/inbox/ticketStatus.yaml index 78978b4..96d3e68 100644 --- a/YamlCase/inbox/ticketStatus.yaml +++ b/YamlCase/inbox/ticketStatus.yaml @@ -50,7 +50,7 @@ api5: - like: {"$.data.list.unassigned.openCount": "${unassigned_ticket_num}" } api6: - title: 将会话标为已读 + title: 将会话标为未读 url: /api/v1/chatRoom/operate method: post data: {"uid":"${userId}","uType":2,"platform":1,"roomId":"${read_ticket_id}","clientId":"${willdesk_clientId}","event":"unread","username":"${name}","isMark":false,"allocationUid":"${userId}","v":"${v}"} diff --git a/YamlCase/report/report.yaml b/YamlCase/report/report.yaml new file mode 100644 index 0000000..6429555 --- /dev/null +++ b/YamlCase/report/report.yaml @@ -0,0 +1,15 @@ +api1: + title: 检查报告列表是否ping通 + url: /api/v1/dataservice/local/dataReport + method: post + data: {"startTime":1712592000,"endTime":1713196799,"timeZone":"Asia/Shanghai","v":"${v}"} + expected: + - eq: {"$.code" : 0} + +api2: + title: 检查导出报告的接口是否pign通 + url: /api/v1/dataservice/local/sendExportMail + method: post + data: { "startTime": 1712592000,"endTime": 1713196799,"timeZone": "Asia/Shanghai","v": "${v}" } + expected: + - eq: {"$.code" : 0} diff --git a/conftest.py b/conftest.py index 001fb04..1ba4598 100644 --- a/conftest.py +++ b/conftest.py @@ -61,6 +61,7 @@ def willdesk_login(): setattr(global_variate.Global,'name',name) setattr(global_variate.Global,'shopList',shopList) setattr(global_variate.Global,'shopId',shopList[0]['id']) + setattr(global_variate.Global,'shopDomain',shopList[0]['shopDomain']) setattr(global_variate.Global,'companyId',companyId) def customer_login(): -- GitLab