"git@172.16.40.31:zhanhuasheng/willdesk_apiauto.git" did not exist on "b29ad28f514a29bec7e4eb1101307f6b5f4d4bea"
Commit d52e1d38 authored by zhanhuasheng's avatar zhanhuasheng

新增用例

parent bd758b61
from Utils.global_variate import Global
class ticketDetailData(Global):
pass
\ No newline at end of file
noteMsg = 'test_note'
\ No newline at end of file
import random
from Utils.sql_handler import test_env_conn
from TestData.inbox.ticketDetail_test_data import ticketDetailData
......@@ -15,6 +17,7 @@ customer_select_sql = f'select * from `customer` where id = {customer_id}'
customer_select_result = test_env_conn.select_one_value(sql=customer_select_sql)
customer_time_zone = customer_select_result['time_zone']
customer_location = customer_select_result['location']
customer_name = customer_select_result['name']
customer_email = customer_select_result['email']
customer_phone = customer_select_result['phone']
customer_is_visitor = customer_select_result['is_visitor']
......@@ -25,3 +28,6 @@ setattr(ticketDetailData, 'customer_email', customer_email)
setattr(ticketDetailData, 'customer_phone', customer_phone)
setattr(ticketDetailData, 'customer_is_visitor', customer_is_visitor)
setattr(ticketDetailData, 'customer_last_msg_time', customer_last_msg_time)
setattr(ticketDetailData, 'customer_name', customer_name)
......@@ -13,3 +13,86 @@ api1:
- eq: {"$.data.isVisitor" : "${customer_is_visitor}"}
- eq: {"$.data.customerId" : "${customer_id}"}
- eq: {"$.data.lastSeenTime" : "'${customer_last_msg_time}'"}
api2:
title: 设置笔记注释
url: /api/v1/note/edit
method: post
data: {"id":0,"uid":"${customer_id}","uType":1,"customerServiceName":"${customer_name}","noteMsg":"${noteMsg}","siteId":"${shopId}","v":"${v}"}
set_value: {"note_id" : "$.data.id"}
expected:
- eq: {"$.code" : 0}
api3:
title: 检查笔记注释是否设置
url: /api/v1/note/list
method: post
data: {"uid":"${customer_id}","uType":1,"customerServiceName":"${customer_name}","siteId":"${shopId}","page":1,"pageSize":2,"v":"${v}"}
expected:
- eq: {"$.code" : 0}
- eq: {"$.data.list[0].id" : "${note_id}"}
- eq: {"$.data.list[?(@.id == '${note_id}')].noteMsg" : "${noteMsg}"}
api4:
title: 删除笔记注释
url: /api/v1/note/delete
method: post
data: {"id":"${note_id}","v":"${v}"}
expected:
- eq: {"$.code" : 0}
api5:
title: 检查获取shopify订单的接口是否正常
url: /api/v1/order/getCustomerOrderList
method: post
data: {"email":"${customer_email}","pageNum":1,"pageSize":2,"shopId":"${shopId}","phone":"${customer_phone}","v":"${v}"}
expected:
- eq: {"$.code" : 0}
api6:
title: 设置快捷发送为ctrl + enter
url: /api/v1/customerService/updateCustomerServiceAccount
method: post
data: {"id":"${userId}","enterType":2,"v":"${v}"}
expected:
- eq: {"$.code" : 0}
api7:
title: 检查快捷发送是否设置成功
url: /api/v1/customerService/getCustomerServiceInfo?v=${v}
method: get
expected:
- eq: {"$.code" : 0}
- eq: {"$.data.enterType" : 2}
api8:
title: 设置快捷发送为shift + enter
url: /api/v1/customerService/updateCustomerServiceAccount
method: post
data: {"id":"${userId}","enterType":3,"v":"${v}"}
expected:
- eq: {"$.code" : 0}
api9:
title: 检查快捷发送是否设置成功
url: /api/v1/customerService/getCustomerServiceInfo?v=${v}
method: get
expected:
- eq: {"$.code" : 0}
- eq: {"$.data.enterType" : 3}
api10:
title: 设置快捷发送为enter
url: /api/v1/customerService/updateCustomerServiceAccount
method: post
data: {"id":"${userId}","enterType":1,"v":"${v}"}
expected:
- eq: {"$.code" : 0}
api11:
title: 检查快捷发送是否设置成功
url: /api/v1/customerService/getCustomerServiceInfo?v=${v}
method: get
expected:
- eq: {"$.code" : 0}
- eq: {"$.data.enterType" : 1}
\ No newline at end of file
......@@ -4,7 +4,7 @@ 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',r'C:\Users\rd71\PycharmProjects\willdesk_api_auto\TestCase\inbox\test_06_channel.py',f'--html=./report.html']) #allure报告一直生成不了,改用pytest自带报告
pytest.main(['-vs',r'C:\Users\rd71\PycharmProjects\willdesk_api_auto\TestCase',f'--html=./report.html']) #allure报告一直生成不了,改用pytest自带报告
finally:
......
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