Commit f11a98e5 authored by zhanhuasheng's avatar zhanhuasheng

1、新增失败重试机制

2、用例执行之间增加等待时间,避免连接池打满
3、新增用例
parent b0b66f06
......@@ -33,4 +33,9 @@ port = 3306
account = willdesk
#密码
password = uitSElgrwLp6vFG
\ No newline at end of file
password = uitSElgrwLp6vFG
[rerun]
rerun = 1
rerun_delay = 3
\ No newline at end of file
......@@ -7,6 +7,7 @@ class TestFAQ:
yaml_path = r'FAQ\article_info.yaml'
yaml_data = yaml_handler.yaml_handler.get_case(yaml_path)
@pytest.mark.flaky(reruns=articleInfoTestData.rerun, reruns_delay=articleInfoTestData.rerun_delay)
@pytest.mark.parametrize('case',yaml_data)
def test_article(self,case):
req_handler.ReqHandler.send_requests(case=case,var_class=articleInfoTestData)
......
......@@ -7,6 +7,7 @@ class TestArticleOpreate:
yaml_path = r'FAQ\article_opreate.yaml'
yaml_data = yaml_handler.yaml_handler.get_case(yaml_path)
@pytest.mark.flaky(reruns=articleOperateTestData.rerun, reruns_delay=articleOperateTestData.rerun_delay)
@pytest.mark.parametrize('case',yaml_data)
def test_article_opreate(self,case):
req_handler.ReqHandler.send_requests(case=case,var_class=articleOperateTestData)
......
......@@ -7,6 +7,7 @@ class TestArticleOpreate:
yaml_path = r'FAQ\article_page_setting.yaml'
yaml_data = yaml_handler.yaml_handler.get_case(yaml_path)
@pytest.mark.flaky(reruns=articlePageSettingTestData.rerun, reruns_delay=articlePageSettingTestData.rerun_delay)
@pytest.mark.parametrize('case',yaml_data)
def test_article_page_setting(self,case):
req_handler.ReqHandler.send_requests(case=case,var_class=articlePageSettingTestData)
......
import pytest
from Utils import yaml_handler
from Utils import req_handler
from Utils.config_handler import configHandler
from TestData.account.account_test_data import accountData
class TestAccount:
yaml_path = r'account/account.yaml'
yaml_data = yaml_handler.yaml_handler.get_case(yaml_path)
@pytest.mark.flaky(reruns=accountData.rerun, reruns_delay=accountData.rerun_delay)
@pytest.mark.parametrize('case',yaml_data)
def test_account(self,case):
req_handler.ReqHandler.send_requests(case=case,var_class=accountData)
......
......@@ -7,6 +7,7 @@ class TestBuyPlan:
yaml_path = r'billing\buyPlan.yaml'
yaml_data = yaml_handler.yaml_handler.get_case(yaml_path)
@pytest.mark.flaky(reruns=buyPlanData.rerun, reruns_delay=buyPlanData.rerun_delay)
@pytest.mark.parametrize('case',yaml_data)
def test_buy_plan(self,case):
req_handler.ReqHandler.send_requests(case=case,var_class=buyPlanData)
......
......@@ -7,6 +7,7 @@ class TestCustomer:
yaml_path = r'customer\customer.yaml'
yaml_data = yaml_handler.yaml_handler.get_case(yaml_path)
@pytest.mark.flaky(reruns=customerData.rerun, reruns_delay=customerData.rerun_delay)
@pytest.mark.parametrize('case',yaml_data)
def test_customer(self,case):
req_handler.ReqHandler.send_requests(case=case,var_class=customerData)
......
......@@ -7,6 +7,7 @@ class TestLivechat:
yaml_path = r'inbox\livechat.yaml'
yaml_data = yaml_handler.yaml_handler.get_case(yaml_path)
@pytest.mark.flaky(reruns=livechatData.rerun, reruns_delay=livechatData.rerun_delay)
@pytest.mark.parametrize('case',yaml_data)
def test_livechat(self,case):
req_handler.ReqHandler.send_requests(case=case,var_class=livechatData)
......
......@@ -7,6 +7,7 @@ class TestTicketStatus:
yaml_path = r'inbox\ticketStatus.yaml'
yaml_data = yaml_handler.yaml_handler.get_case(yaml_path)
@pytest.mark.flaky(reruns=ticketStatusData.rerun, reruns_delay=ticketStatusData.rerun_delay)
@pytest.mark.parametrize('case',yaml_data)
def test_ticketStatus(self,case):
print(case)
......
......@@ -11,6 +11,7 @@ class TestTicketOpreate:
yaml_path = r'inbox\ticketOpreate.yaml'
yaml_data = yaml_handler.yaml_handler.get_case(yaml_path)
@pytest.mark.flaky(reruns=ticketStatusData.rerun, reruns_delay=ticketStatusData.rerun_delay)
@pytest.mark.parametrize('case',yaml_data)
def test_ticketOpreate(self,case):
print(case)
......
......@@ -7,6 +7,7 @@ class TestTicketInfo:
yaml_path = r'inbox\ticketInfo.yaml'
yaml_data = yaml_handler.yaml_handler.get_case(yaml_path)
@pytest.mark.flaky(reruns=ticketInfoData.rerun, reruns_delay=ticketInfoData.rerun_delay)
@pytest.mark.parametrize('case',yaml_data)
def test_ticketInfo(self,case):
print(case)
......
......@@ -7,6 +7,7 @@ class TestTeam:
yaml_path = r'inbox\team.yaml'
yaml_data = yaml_handler.yaml_handler.get_case(yaml_path)
@pytest.mark.flaky(reruns=teamData.rerun, reruns_delay=teamData.rerun_delay)
@pytest.mark.parametrize('case',yaml_data)
def test_team(self,case):
print(case)
......
......@@ -7,6 +7,7 @@ class TestChannel:
yaml_path = r'inbox\channel.yaml'
yaml_data = yaml_handler.yaml_handler.get_case(yaml_path)
@pytest.mark.flaky(reruns=channelData.rerun, reruns_delay=channelData.rerun_delay)
@pytest.mark.parametrize('case',yaml_data)
def test_channel(self,case):
print(case)
......
......@@ -7,6 +7,7 @@ class TestTiocketDetail:
yaml_path = r'inbox\ticketDetail.yaml'
yaml_data = yaml_handler.yaml_handler.get_case(yaml_path)
@pytest.mark.flaky(reruns=ticketDetailData.rerun, reruns_delay=ticketDetailData.rerun_delay)
@pytest.mark.parametrize('case',yaml_data)
def test_ticketDetail(self,case):
print(case)
......
......@@ -7,6 +7,7 @@ class TestReport:
yaml_path = r'report/report.yaml'
yaml_data = yaml_handler.yaml_handler.get_case(yaml_path)
@pytest.mark.flaky(reruns=reportData.rerun, reruns_delay=reportData.rerun_delay)
@pytest.mark.parametrize('case',yaml_data)
def test_report(self,case):
req_handler.ReqHandler.send_requests(case=case,var_class=reportData)
......
......@@ -7,6 +7,8 @@ class TestEmailIntegration:
yaml_path = r'setting\emailIntegration.yaml'
yaml_data = yaml_handler.yaml_handler.get_case(yaml_path)
@pytest.mark.flaky(reruns=emailIntegrationData.rerun, reruns_delay=emailIntegrationData.rerun_delay)
@pytest.mark.parametrize('case',yaml_data)
def test_emailIntegration(self,case):
print(case)
......
......@@ -7,6 +7,7 @@ class TestWhatsappIntegration:
yaml_path = r'setting\whatsappIntegration.yaml'
yaml_data = yaml_handler.yaml_handler.get_case(yaml_path)
@pytest.mark.flaky(reruns=whatsappIntegrationData.rerun, reruns_delay=whatsappIntegrationData.rerun_delay)
@pytest.mark.parametrize('case',yaml_data)
def test_whatsappIntegration(self,case):
print(case)
......
import pytest
from Utils import yaml_handler
from Utils import req_handler
from TestData.setting.widget_setting_test_data import widgetSettingData
class TestWidgetSetting:
yaml_path = r'setting\widgetSetting.yaml'
yaml_data = yaml_handler.yaml_handler.get_case(yaml_path)
@pytest.mark.flaky(reruns=widgetSettingData.rerun, reruns_delay=widgetSettingData.rerun_delay)
@pytest.mark.parametrize('case',yaml_data)
def test_widgetSetting(self,case):
print(case)
req_handler.ReqHandler.send_requests(case=case,var_class=widgetSettingData)
from Utils.global_variate import Global
class widgetSettingData(Global):
enable = "1"
disable = "0"
whatsapp_phone = '8613699807045'
origin_whatsapp_phone = ''
order_track_day_7 = '7'
order_track_day_14 = '14'
order_track_day_60 = '60'
order_track_day_30 = '30'
random_avatar = "{\"showType\":2,\"buserIdList\":[${userId}]}"
hide_avatar = "{\"showType\":1,\"buserIdList\":[${userId}]}"
appoint_avatar = "{\"showType\":3,\"buserIdList\":[${userId}]}"
origin_greeting_word = 'Hi {first_name} 👋'
greeting_word = 'autotest_greeting_word'
origin_team_introduction = 'Contact us or find help articles for support'
team_introduction = 'autotest_team_introduction'
origin_posting_title = 'Welcome to {website name} 😊'
posting_title = 'autotest_posting_title'
origin_posting_content = 'Hey {first_name} 😊We‘re so glad you’re here, let us know if you have any questions.'
posting_content = 'autotest_posting_content'
origin_posting_button_content = 'Message Us'
posting_button_content = 'autotest_posting_button_content'
origin_font_style = 'Inter'
font_style = 'Auton'
origin_background_color = '#2C23E5'
background_color = '#FF4243'
black_font = 'Dark'
white_font = 'Light'
widget_left = 'Left'
widget_right = 'Right'
origin_spacing_px = '50'
side_spacing_px = '500'
bottom_spacing_px = '600'
origin_widget_type = 'buttonType'
widget_type = 'textOnly'
widget_font = 'autotest_widget_font'
origin_widget_font = 'Help'
widget_small = 'small'
widget_medium = 'medium'
widget_large = 'large'
origin_business_time = ''
business_time_range = 'Everyday'
business_time_start = '15:51'
business_time_end = '19:56'
business_time_zone = '(GMT+09:00) Asia/Seoul'
origin_business_time_zone = '(GMT+08:00) Asia/Shanghai'
origin_reply_time_word = 'Our usual reply time'
origin_chatwelcome_message = '{\"one\":\"Thanks for chatting with us! We usually reply to you here or via email.\",\"two\":\"Our usual reply time\",\"three\":\"a few minutes\"}'
chatwelcome_message = '{\"one\":\"Thanks for chatting with us! We usually reply to you here or via email.\",\"two\":\"autotest_reply_time_word\",\"three\":\"autotest_chat_welcome_word\"}'
origin_waiting_time_message = '{\"one\":\"抱歉,我们暂时不在线。如果您有任何问题,请留言或尝试以下方法解决问题。\",\"two\":\"我们将返回\"}'
waiting_time_message = '{\"one\":\"抱歉,我们暂时不在线。如果您有任何问题,请留言或尝试以下方法解决问题。\",\"two\":\"autotest_waiting_time_message\"}'
origin_waiting_time = 'autotest_waiting_time'
waiting_time = '{Waitingtime}'
back_time_word = 'autotest_back_time_word'
wait_time_word = 'autotest_wait_time_word'
visiable_all_time = 'all'
visiable_business_time = 'business'
widget_show_desktop = 'desktop'
widget_show_mobile = 'mobile'
widget_show_all = 'all'
visiable_url = '[{\"type\":\"0\",\"url\":\"${shopDomain}\"}]'
widget_show_special_page = 'show'
widget_hide_special_page = 'hide'
widget_show_all_page = 'all'
\ No newline at end of file
......@@ -21,7 +21,9 @@ else:
email_select_sql = f'select * from `email_config` where brand_id = {emailIntegrationData.brandId} and email = "{email_address}"'
email_select_result = test_env_conn.select_one_value(sql=email_select_sql)
email_id = email_select_result['id']
email_num = 1
email_select_sql = f'select * from `email_config` where brand_id = {emailIntegrationData.brandId}'
email_select_result = test_env_conn.select_many_value(sql=email_select_sql)
email_num = len(email_select_result)
setattr(emailIntegrationData, 'email_id', email_id)
setattr(emailIntegrationData, 'email_address', email_address)
......
from Utils import config_handler
class Global:
'''
公用变量类,所有的子变量类继承该类,存取公用变量,公用变量类默认存token等基础信息
'''
rerun = int(config_handler.base_config.get_value('rerun','rerun'))
rerun_delay = int(config_handler.base_config.get_value('rerun','rerun_delay'))
......@@ -66,6 +66,7 @@ class ReqHandler:
if case.get('sleep'):
time.sleep(float(case['sleep']))
return 1
time.sleep(1) #https请求延时1秒,避免打满连接池
url = case['url'] if 'http' in case['url'] else config_handler.base_config.get_value('url','test_address') + case['url'] #判断是否有域名,没有的话给config文件中的默认测试域名
method = case['method']
expected = case['expected']
......
......@@ -33,13 +33,14 @@ class webhookHandler:
},
}
res = requests.post(url=self.webhookUrl,json=data)
print(res.json())
# print(res.json())
def sendMsg(self,text,msgtype):
def sendMsg(self,title,text):
data = {
"msgtype": msgtype,
"text": {
"content": text
"msgtype": 'markdown',
"markdown": {
"title": title,
"text": text
}
}
res = requests.post(url=self.webhookUrl,data=data)
......
api1:
title: 更改挂件设置
url: /api/v1/setting/updateShopSetting
method: post
data: {"item":[{"shopId":"${shopId}","itemId":71,"itemValue":"${disable}","itemName":"mainSwitch"},{"shopId":"${shopId}","itemId":37,"itemValue":"${disable}","itemName":"enableLiveChat"},{"shopId":"${shopId}","itemId":39,"itemValue":"${disable}","itemName":"whatsApp"},{"shopId":"${shopId}","itemId":38,"itemValue":"${disable}","itemName":"displayContactForm"},{"shopId":"${shopId}","itemId":42,"itemValue":"${disable}","itemName":"orderTrack"},{"shopId":"${shopId}","itemId":49,"itemValue":"${disable}","itemName":"showFaq"},{"shopId":"${shopId}","itemId":183,"itemValue":"${appoint_avatar}","itemName":"agentAvatarSettings"},{"shopId":"${shopId}","itemId":56,"itemValue":"${greeting_word}","itemName":"welcomeGreetings"},{"shopId":"${shopId}","itemId":57,"itemValue":"${team_introduction}","itemName":"welcomeIntroduction"},{"shopId":"${shopId}","itemId":59,"itemValue":"${disable}","itemName":"welcomeDisplay"},{"shopId":"${shopId}","itemId":52,"itemValue":"${black_font}","itemName":"textColor"},{"shopId":"${shopId}","itemId":53,"itemValue":"${widget_left}","itemName":"launcherPosition"},{"shopId":"${shopId}","itemId":94,"itemValue":"${font_style}","itemName":"fontStyle"},{"shopId":"${shopId}","itemId":50,"itemValue":"${background_color}","itemName":"primaryColor"},{"shopId":"${shopId}","itemId":60,"itemValue":"${posting_title}","itemName":"welcomeTitle"},{"shopId":"${shopId}","itemId":61,"itemValue":"${posting_content}","itemName":"welcomeContent"},{"shopId":"${shopId}","itemId":93,"itemValue":"${posting_button_content}","itemName":"welcomeMessageUs"},{"shopId":"${shopId}","itemId":54,"itemValue":"${side_spacing_px}","itemName":"sideSpacing"},{"shopId":"${shopId}","itemId":55,"itemValue":"${bottom_spacing_px}","itemName":"bottomSpacing"},{"shopId":"${shopId}","itemId":58,"itemValue":"${widget_font}","itemName":"welcomeCTA"},{"shopId":"${shopId}","itemId":113,"itemValue":"${widget_type}","itemName":"buttonType"},{"shopId":"${shopId}","itemId":116,"itemValue":"${widget_medium}","itemName":"iconSize"},{"shopId":"${shopId}","itemId":66,"itemValue":"${business_time_zone}","itemName":"businessTimeZone"},{"shopId":"${shopId}","itemId":73,"itemValue":"${chatwelcome_message}","itemName":"chatWelcomeMsg"},{"shopId":"${shopId}","itemId":69,"itemValue":"${disable}","itemName":"visitorDataName"},{"shopId":"${shopId}","itemId":63,"itemValue":"${business_time_range}","itemName":"businessTimeRange"},{"shopId":"${shopId}","itemId":64,"itemValue":"${business_time_start}","itemName":"businessTimeStart"},{"shopId":"${shopId}","itemId":65,"itemValue":"${business_time_end}","itemName":"businessTimeEnd"},{"shopId":"${shopId}","itemId":70,"itemValue":"${disable}","itemName":"visitorDataEmail"},{"shopId":"${shopId}","itemId":83,"itemValue":"${disable}","itemName":"visitorDataPhone"},{"shopId":"${shopId}","itemId":68,"itemValue":"${disable}","itemName":"visitorDataCollection"},{"shopId":"${shopId}","itemId":106,"itemValue":"${visiable_business_time}","itemName":"visibilityTime"},{"shopId":"${shopId}","itemId":107,"itemValue":"${widget_show_desktop}","itemName":"visibilityDevices"},{"shopId":"${shopId}","itemId":108,"itemValue":"${widget_show_special_page}","itemName":"visibilityPageSetting"},{"shopId":"${shopId}","itemId":109,"itemValue":"${visiable_url}"},{"shopId":"${shopId}","itemId":82,"itemValue":"${order_track_day_14}","itemName":"trackDays"},{"shopId":"${shopId}","itemId":74,"itemValue":"${waiting_time_message}","itemName":"chatNonworkMsg"},{"shopId":"${shopId}","itemId":168,"itemValue":"${waiting_time}","itemName":"chatNonworkMsgTime"}],"v":"${v}"}
expected:
- eq: {"$.code" : 0}
api2:
title: 检查设置是否成功
url: /api/v1/setting/getCShopSetting?domain=${shopDomain}
method: get
expected:
- eq: {"$.code" : 0}
- eq: {"$.data.settingInfo[?(@.itemId == 71)].itemValue" : "${disable}"}
- eq: {"$.data.settingInfo[?(@.itemId == 37)].itemValue" : "${disable}"}
- eq: {"$.data.settingInfo[?(@.itemId == 39)].itemValue" : "${disable}"}
- eq: {"$.data.settingInfo[?(@.itemId == 38)].itemValue" : "${disable}"}
- eq: {"$.data.settingInfo[?(@.itemId == 42)].itemValue" : "${disable}"}
- eq: {"$.data.settingInfo[?(@.itemId == 49)].itemValue" : "${disable}"}
- eq: {"$.data.settingInfo[?(@.itemId == 183)].itemValue" : "${appoint_avatar}"}
- eq: {"$.data.settingInfo[?(@.itemId == 56)].itemValue" : "${greeting_word}"}
- eq: {"$.data.settingInfo[?(@.itemId == 57)].itemValue" : "${team_introduction}"}
- eq: {"$.data.settingInfo[?(@.itemId == 59)].itemValue" : "${disable}"}
- eq: {"$.data.settingInfo[?(@.itemId == 52)].itemValue" : "${black_font}"}
- eq: {"$.data.settingInfo[?(@.itemId == 53)].itemValue" : "${widget_left}"}
- eq: {"$.data.settingInfo[?(@.itemId == 94)].itemValue" : "${font_style}"}
- eq: {"$.data.settingInfo[?(@.itemId == 50)].itemValue" : "${background_color}"}
- eq: {"$.data.settingInfo[?(@.itemId == 60)].itemValue" : "${posting_title}"}
- eq: {"$.data.settingInfo[?(@.itemId == 61)].itemValue" : "${posting_content}"}
- eq: {"$.data.settingInfo[?(@.itemId == 54)].itemValue" : "${side_spacing_px}"}
- eq: {"$.data.settingInfo[?(@.itemId == 55)].itemValue" : "${bottom_spacing_px}"}
- eq: {"$.data.settingInfo[?(@.itemId == 58)].itemValue" : "${widget_font}"}
- eq: {"$.data.settingInfo[?(@.itemId == 113)].itemValue" : "${widget_type}"}
- eq: {"$.data.settingInfo[?(@.itemId == 116)].itemValue" : "${widget_medium}"}
- eq: {"$.data.settingInfo[?(@.itemId == 66)].itemValue" : "${business_time_zone}"}
- eq: {"$.data.settingInfo[?(@.itemId == 73)].itemValue" : "${chatwelcome_message}"}
- eq: {"$.data.settingInfo[?(@.itemId == 69)].itemValue" : "${disable}"}
- eq: {"$.data.settingInfo[?(@.itemId == 63)].itemValue" : "${business_time_range}"}
- eq: {"$.data.settingInfo[?(@.itemId == 64)].itemValue" : "${business_time_start}"}
- eq: {"$.data.settingInfo[?(@.itemId == 65)].itemValue" : "${business_time_end}"}
- eq: {"$.data.settingInfo[?(@.itemId == 70)].itemValue" : "${disable}"}
- eq: {"$.data.settingInfo[?(@.itemId == 83)].itemValue" : "${disable}"}
- eq: {"$.data.settingInfo[?(@.itemId == 68)].itemValue" : "${disable}"}
- eq: {"$.data.settingInfo[?(@.itemId == 106)].itemValue" : "${visiable_business_time}"}
- eq: {"$.data.settingInfo[?(@.itemId == 107)].itemValue" : "${widget_show_desktop}"}
- eq: {"$.data.settingInfo[?(@.itemId == 108)].itemValue" : "${widget_show_special_page}"}
- eq: {"$.data.settingInfo[?(@.itemId == 109)].itemValue" : "${visiable_url}"}
- eq: {"$.data.settingInfo[?(@.itemId == 82)].itemValue" : "${order_track_day_14}"}
- eq: {"$.data.settingInfo[?(@.itemId == 74)].itemValue" : "${waiting_time_message}"}
- eq: {"$.data.settingInfo[?(@.itemId == 168)].itemValue" : "${waiting_time}"}
api3:
title: 更改挂件设置
url: /api/v1/setting/updateShopSetting
method: post
data: {"item":[{"shopId":"${shopId}","itemId":183,"itemValue":"${hide_avatar}","itemName":"agentAvatarSettings"},{"shopId":"${shopId}","itemId":40,"itemValue":"${whatsapp_phone}","itemName":"contactNumber"},{"shopId":"${shopId}","itemId":82,"itemValue":"${order_track_day_60}","itemName":"trackDays"},{"shopId":"${shopId}","itemId":116,"itemValue":"${widget_small}","itemName":"iconSize"},{"shopId":"${shopId}","itemId":107,"itemValue":"${widget_show_mobile}","itemName":"visibilityDevices"},{"shopId":"${shopId}","itemId":108,"itemValue":"${widget_hide_special_page}","itemName":"visibilityPageSetting"}],"v": "${v}" }
expected:
- eq: {"$.code": 0 }
api4:
title: 检查设置是否成功
url: /api/v1/setting/getCShopSetting?domain=${shopDomain}
method: get
expected:
- eq: {"$.code" : 0}
- eq: {"$.data.settingInfo[?(@.itemId == 183)].itemValue": "${hide_avatar}"}
- eq: {"$.data.settingInfo[?(@.itemId == 40)].itemValue": "${whatsapp_phone}"}
- eq: {"$.data.settingInfo[?(@.itemId == 82)].itemValue": "${order_track_day_60}"}
- eq: {"$.data.settingInfo[?(@.itemId == 116)].itemValue": "${widget_small}"}
- eq: {"$.data.settingInfo[?(@.itemId == 107)].itemValue": "${widget_show_mobile}"}
- eq: {"$.data.settingInfo[?(@.itemId == 108)].itemValue": "${widget_hide_special_page}"}
api5:
title: 更改挂件设置
url: /api/v1/setting/updateShopSetting
method: post
data: {"item":[{"shopId":"${shopId}","itemId":82,"itemValue":"${order_track_day_7}","itemName":"trackDays"}],"v": "${v}" }
expected:
- eq: {"$.code": 0 }
api6:
title: 检查设置是否成功
url: /api/v1/setting/getCShopSetting?domain=${shopDomain}
method: get
expected:
- eq: {"$.code" : 0}
- eq: {"$.data.settingInfo[?(@.itemId == 82)].itemValue": "${order_track_day_7}"}
api7:
title: 还原挂件设置
url: /api/v1/setting/updateShopSetting
method: post
data: {"item":[{"shopId":"${shopId}","itemId":71,"itemValue":"${enable}","itemName":"mainSwitch"},{"shopId":"${shopId}","itemId":37,"itemValue":"${enable}","itemName":"enableLiveChat"},{"shopId":"${shopId}","itemId":39,"itemValue":"${enable}","itemName":"whatsApp"},{"shopId":"${shopId}","itemId":38,"itemValue":"${enable}","itemName":"displayContactForm"},{"shopId":"${shopId}","itemId":42,"itemValue":"${enable}","itemName":"orderTrack"},{"shopId":"${shopId}","itemId":49,"itemValue":"${enable}","itemName":"showFaq"},{"shopId":"${shopId}","itemId":183,"itemValue":"${random_avatar}","itemName":"agentAvatarSettings"},{"shopId":"${shopId}","itemId":56,"itemValue":"${origin_greeting_word}","itemName":"welcomeGreetings"},{"shopId":"${shopId}","itemId":57,"itemValue":"${origin_team_introduction}","itemName":"welcomeIntroduction"},{"shopId":"${shopId}","itemId":60,"itemValue":"${origin_posting_title}","itemName":"welcomeTitle"},{"shopId":"${shopId}","itemId":59,"itemValue":"${enable}","itemName":"welcomeDisplay"},{"shopId":"${shopId}","itemId":61,"itemValue":"${origin_posting_content}","itemName":"welcomeContent"},{"shopId":"${shopId}","itemId":93,"itemValue":"${origin_posting_button_content}","itemName":"welcomeMessageUs"},{"shopId":"${shopId}","itemId":50,"itemValue":"${origin_background_color}","itemName":"primaryColor"},{"shopId":"${shopId}","itemId":94,"itemValue":"${origin_font_style}","itemName":"fontStyle"},{"shopId":"${shopId}","itemId":52,"itemValue":"${white_font}","itemName":"textColor"},{"shopId":"${shopId}","itemId":53,"itemValue":"${widget_right}","itemName":"launcherPosition"},{"shopId":"${shopId}","itemId":54,"itemValue":"${origin_spacing_px}","itemName":"sideSpacing"},{"shopId":"${shopId}","itemId":55,"itemValue":"${origin_spacing_px}","itemName":"bottomSpacing"},{"shopId":"${shopId}","itemId":113,"itemValue":"${origin_widget_type}","itemName":"buttonType"},{"shopId":"${shopId}","itemId":58,"itemValue":"${origin_widget_font}","itemName":"welcomeCTA"},{"shopId":"${shopId}","itemId":116,"itemValue":"${widget_large}","itemName":"iconSize"},{"shopId":"${shopId}","itemId":66,"itemValue":"${origin_business_time_zone}","itemName":"businessTimeZone"},{"shopId":"${shopId}","itemId":73,"itemValue":"${origin_chatwelcome_message}","itemName":"chatWelcomeMsg"},{"shopId":"${shopId}","itemId":63,"itemValue":"${origin_business_time}","itemName":"businessTimeRange"},{"shopId":"${shopId}","itemId":64,"itemValue":"${origin_business_time}","itemName":"businessTimeStart"},{"shopId":"${shopId}","itemId":65,"itemValue":"${origin_business_time}","itemName":"businessTimeEnd"},{"shopId":"${shopId}","itemId":69,"itemValue":"${enable}","itemName":"visitorDataName"},{"shopId":"${shopId}","itemId":70,"itemValue":"${enable}","itemName":"visitorDataEmail"},{"shopId":"${shopId}","itemId":83,"itemValue":"${enable}","itemName":"visitorDataPhone"},{"shopId":"${shopId}","itemId":68,"itemValue":"${enable}","itemName":"visitorDataCollection"},{"shopId":"${shopId}","itemId":106,"itemValue":"${visiable_all_time}","itemName":"visibilityTime"},{"shopId":"${shopId}","itemId":107,"itemValue":"${widget_show_all}","itemName":"visibilityDevices"},{"shopId":"${shopId}","itemId":108,"itemValue":"${widget_show_all_page}","itemName":"visibilityPageSetting"},{"shopId":"${shopId}","itemId":82,"itemValue":"${order_track_day_30}","itemName":"trackDays"},{"shopId":"${shopId}","itemId":74,"itemValue":"${origin_waiting_time_message}","itemName":"chatNonworkMsg"},{"shopId":"${shopId}","itemId":168,"itemValue":"${origin_waiting_time}","itemName":"chatNonworkMsgTime"}],"v":"${v}"}
expected:
- eq: {"$.code": 0}
api8:
title: 检查设置是否成功
url: /api/v1/setting/getCShopSetting?domain=${shopDomain}
method: get
expected:
- eq: {"$.code" : 0}
- eq: {"$.data.settingInfo[?(@.itemId == 71)].itemValue" : "${enable}"}
- eq: {"$.data.settingInfo[?(@.itemId == 37)].itemValue" : "${enable}"}
- eq: {"$.data.settingInfo[?(@.itemId == 39)].itemValue" : "${enable}"}
- eq: {"$.data.settingInfo[?(@.itemId == 38)].itemValue" : "${enable}"}
- eq: {"$.data.settingInfo[?(@.itemId == 42)].itemValue" : "${enable}"}
- eq: {"$.data.settingInfo[?(@.itemId == 49)].itemValue" : "${enable}"}
- eq: {"$.data.settingInfo[?(@.itemId == 183)].itemValue" : "${random_avatar}"}
- eq: {"$.data.settingInfo[?(@.itemId == 56)].itemValue" : "${origin_greeting_word}"}
- eq: {"$.data.settingInfo[?(@.itemId == 57)].itemValue" : "${origin_team_introduction}"}
- eq: {"$.data.settingInfo[?(@.itemId == 59)].itemValue" : "${enable}"}
- eq: {"$.data.settingInfo[?(@.itemId == 52)].itemValue" : "${white_font}"}
- eq: {"$.data.settingInfo[?(@.itemId == 53)].itemValue" : "${widget_right}"}
- eq: {"$.data.settingInfo[?(@.itemId == 94)].itemValue" : "${origin_font_style}"}
- eq: {"$.data.settingInfo[?(@.itemId == 50)].itemValue" : "${origin_background_color}"}
- eq: {"$.data.settingInfo[?(@.itemId == 60)].itemValue" : "${origin_posting_title}"}
- eq: {"$.data.settingInfo[?(@.itemId == 61)].itemValue" : "${origin_posting_content}"}
- eq: {"$.data.settingInfo[?(@.itemId == 54)].itemValue" : "${origin_spacing_px}"}
- eq: {"$.data.settingInfo[?(@.itemId == 55)].itemValue" : "${origin_spacing_px}"}
- eq: {"$.data.settingInfo[?(@.itemId == 58)].itemValue" : "${origin_widget_font}"}
- eq: {"$.data.settingInfo[?(@.itemId == 113)].itemValue" : "${origin_widget_type}"}
- eq: {"$.data.settingInfo[?(@.itemId == 116)].itemValue" : "${widget_large}"}
- eq: {"$.data.settingInfo[?(@.itemId == 66)].itemValue" : "${origin_business_time_zone}"}
- eq: {"$.data.settingInfo[?(@.itemId == 73)].itemValue" : "${origin_chatwelcome_message}"}
- eq: {"$.data.settingInfo[?(@.itemId == 69)].itemValue" : "${enable}"}
- eq: {"$.data.settingInfo[?(@.itemId == 63)].itemValue" : "${origin_business_time}"}
- eq: {"$.data.settingInfo[?(@.itemId == 64)].itemValue" : "${origin_business_time}"}
- eq: {"$.data.settingInfo[?(@.itemId == 65)].itemValue" : "${origin_business_time}"}
- eq: {"$.data.settingInfo[?(@.itemId == 70)].itemValue" : "${enable}"}
- eq: {"$.data.settingInfo[?(@.itemId == 83)].itemValue" : "${enable}"}
- eq: {"$.data.settingInfo[?(@.itemId == 68)].itemValue" : "${enable}"}
- eq: {"$.data.settingInfo[?(@.itemId == 106)].itemValue" : "${visiable_all_time}"}
- eq: {"$.data.settingInfo[?(@.itemId == 107)].itemValue" : "${widget_show_all}"}
- eq: {"$.data.settingInfo[?(@.itemId == 108)].itemValue" : "${widget_show_all_page}"}
- eq: {"$.data.settingInfo[?(@.itemId == 109)].itemValue" : "${visiable_url}"}
- eq: {"$.data.settingInfo[?(@.itemId == 82)].itemValue" : "${order_track_day_30}"}
- eq: {"$.data.settingInfo[?(@.itemId == 74)].itemValue" : "${origin_waiting_time_message}"}
- eq: {"$.data.settingInfo[?(@.itemId == 168)].itemValue" : "${origin_waiting_time}"}
\ No newline at end of file
import pytest
import requests.exceptions
from Utils.webhook_handler import webhook
from Utils.sql_handler import test_env_conn
if __name__ == '__main__':
try:
# pytest.main(['-vs',r'C:\Users\rd71\PycharmProjects\willdesk_api_auto\TestCase\inbox\test_06_channel.py',f'--alluredir=./allureReports/json','--clean-alluredir'])
pytest.main(['-vs','./TestCase/setting/test_02_whatsappIntegration.py',f'--html=./report.html']) #allure报告一直生成不了,改用pytest自带报告
pytest.main(['-vs','./TestCase',f'--html=./report.html']) #allure报告一直生成不了,改用pytest自带报告
finally:
test_env_conn.close_db() #关闭数据库链接
......
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