Commit 36cc01b6 authored by zhanhuasheng's avatar zhanhuasheng

bugfix

parent f11a98e5
......@@ -4,4 +4,4 @@ class emailIntegrationData(Global):
append_email_address = 'autotest@channelwill.cn'
append_email_name = 'autotest'
append_email_status = 0
new_email_name = 'autotest2'
\ No newline at end of file
new_email_name = 'autotest2'
from Utils.sql_handler import test_env_conn
from TestData.account.account_test_data import accountData
select_sql = f'select * from willdesk.customer_service where id = {accountData.userId} '
select_sql = f'select * from willdesk.customer_service where id = {accountData.userId}'
select_result = test_env_conn.select_one_value(sql=select_sql)
assert select_result['local_lang'] == accountData.target_language
\ No newline at end of file
setattr(accountData, 'local_lang', select_result['local_lang'])
# assert select_result['local_lang'] == accountData.target_language
\ No newline at end of file
from Utils.sql_handler import test_env_conn
from TestData.setting.email_integration_test_data import emailIntegrationData
email_select_sql = f'select * from `email_config` where brand_id = {emailIntegrationData.brandId} and email = "{emailIntegrationData.append_email_address}"'
email_select_result = test_env_conn.select_one_value(email_select_sql)
if not email_select_result:
email_insert_sql = f"""INSERT INTO willdesk.email_config (brand_id,email_servicer_id,email,email_name,auth_code,refresh_token,raw_token,code_type,imap_addr,imap_port,imap_ssl,smtp_addr,smtp_port,smtp_ssl,enable_signature,signature_content,auth_folder,connect_status,failed_reason,status,create_at,update_at) VALUES
({emailIntegrationData.brandId},7,'{emailIntegrationData.append_email_address}','{emailIntegrationData.append_email_name}','OJezniff5cTye4CqPyr3KA5F8HwmLiwyTAlBvYRKeWw=','','',0,'imap.com',993,0,'smtp.com',587,0,0,'<p >Best wishes&nbsp;</p><span class="agent-name unique-tags" contenteditable="false">Agent name</span> | <span>Customer Support</span>','1',1,'',{emailIntegrationData.append_email_status},'2024-04-19 17:11:37','2024-04-19 17:11:48');
"""
test_env_conn.execute_sql(email_insert_sql)
\ No newline at end of file
......@@ -51,6 +51,14 @@ api6:
expected:
- eq: {"$.code" : 0}
api7:
title: 检查设置语言
url: /api/v1/customerService/getCustomerServiceInfo?v=${v}
method: get
expected:
- eq: { "$.code": 0 }
- eq: {"${local_lang}" : "${target_language}"}
api8:
title: 检查翻译文本接口
url: /api/v1/translate/transKeyValue
......
......@@ -11,6 +11,7 @@ api2:
title: 检查邮箱是否添加成功
url: /api/v1/email/listEmailConfig
method: post
before_sql: /setting/emailIntegration/emailIntegration_insert.py
data: {"v":"${v}"}
expected:
- eq: {"$.code": 0}
......
import pytest
import requests.exceptions
from Utils.webhook_handler import webhook
from Utils.sql_handler import test_env_conn
import os
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',f'--html=./report.html']) #allure报告一直生成不了,改用pytest自带报告
# pytest_run_command = 'pytest ./TestCase -vs -n=3 --reruns=1 --reruns-delay=3 --html=./report.html'
# os.system(pytest_run_command)
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