diff --git a/TestData/inbox/ticketDetail_test_data.py b/TestData/inbox/ticketDetail_test_data.py index 3ed2f8200c8b238d99074b3e3a87d92875438049..d698a4e1b584f85c17f51a8d18dbe4ad72777f14 100644 --- a/TestData/inbox/ticketDetail_test_data.py +++ b/TestData/inbox/ticketDetail_test_data.py @@ -1,4 +1,4 @@ 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 diff --git a/TestFile/inbox/ticketDetail_select.py b/TestFile/inbox/ticketDetail_select.py index 9d444b9196099684f405b3e3bdc12ab64d432ed6..64b86e2a5dec5bb6ead58f5797e41bbbd0fb09d2 100644 --- a/TestFile/inbox/ticketDetail_select.py +++ b/TestFile/inbox/ticketDetail_select.py @@ -1,3 +1,5 @@ +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) + + diff --git a/YamlCase/inbox/ticketDetail.yaml b/YamlCase/inbox/ticketDetail.yaml index 82a26d5f1c1c109cc30f0678007fdb0b91b54075..37990fb862828987d90c1274f4948be3ce9a80ea 100644 --- a/YamlCase/inbox/ticketDetail.yaml +++ b/YamlCase/inbox/ticketDetail.yaml @@ -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 diff --git a/main.py b/main.py index 9c31c9a168296ea3a123c4097e2350b7cfa0eba4..9281f4ebf3716bcc6481a756afb8972ee2681c34 100644 --- a/main.py +++ b/main.py @@ -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: