api1: title: 新建一个workflow url: /api/v1/rule/updateRuleDefine method: post data: {"tplId":"${workflow_parent_template_id}","ruleName":"${workflow_name}","ruleDescribe":"${workflow_describe}","ruleId":"","status":"${workflow_status}","brandId":"${brandId}","eventId":"${event_id}","childRule":0,"ruleType":"Triggers","ruleLogic":"${create_workflow_data}","v":"${v}"} before_sql: automation/workflow/workflow_template_select.py set_value: {"create_workflow_id": "$.data.ruleId"} expected: - eq: {"$.code": 0} api2: title: 检查是否新建成功 url: /api/v1/rule/ruleList method: post data: {"page":1,"pageSize":100,"brandId":"${brandId}","tplId":"${workflow_parent_template_id}","v":"${v}"} before_sql: automation/workflow/workflow_select.py expected: - eq: {"$.code": 0} - eq: {"$.data.total": "${workflow_num}"} - eq: {"$.data.ruleList[?(@.ruleId == '${select_workflow_id}')].ruleName": "${select_workflow_name}"} - eq: {"$.data.ruleList[?(@.ruleId == '${select_workflow_id}')].sorts": "${select_workflow_sort}"} - eq: {"$.data.ruleList[?(@.ruleId == '${select_workflow_id}')].status": "${select_workflow_status}"} - in_list: {"$.data.ruleList[*].ruleId": "${create_workflow_id}"} - eq: {"$.data.ruleList[?(@.ruleId == '${create_workflow_id}')].ruleName": "${workflow_name}"} - in: {"$.data.ruleList[?(@.ruleId == '${create_workflow_id}')].ruleLogic.logicIf.result[0].inner[0].objValue": "${workflow_msg}"} api3: title: 更新workflow url: /api/v1/rule/updateRuleDefine method: post data: {"tplId":"${workflow_parent_template_id}","ruleName":"${workflow_name}","ruleDescribe":"${workflow_describe}","ruleId":"${create_workflow_id}","status":"${workflow_status}","brandId":"${brandId}","eventId":"${event_id}","childRule":0,"ruleType":"Triggers","ruleLogic":"${create_workflow_data2}","v":"${v}"} expected: - eq: {"$.code": 0} api4: title: 检查是否更新成功 url: /api/v1/rule/ruleList method: post data: {"page":1,"pageSize":100,"brandId":"${brandId}","tplId":"${workflow_parent_template_id}","v":"${v}"} expected: - eq: {"$.code": 0} - eq: {"$.data.ruleList[?(@.ruleId == '${create_workflow_id}')].ruleName": "${workflow_name}"} - in: {"$.data.ruleList[?(@.ruleId == '${create_workflow_id}')].ruleLogic.logicIf.result[0].inner[0].objValue": "${workflow_update_msg}"} api5: title: c端主动发起会话触发workflow ws: customer action: sendmsg data: type: text api6: title: c端检查是否触发workflow url: /api/v1/chatRecord/customerList method: post data: {"uid":"${customerId}","uType":1,"platform":1,"siteId":"${shopId}","sendTime":0,"pageSize":20,"v":"${customer_v}"} expected: - eq: {"$.code": 0 } - not_in: {"$.data.list[0].content": "${workflow_update_msg}"} api7: title: 开启workflow url: /api/v1/rule/updateRuleStatus method: post data: {"status":1,"ruleId":"${create_workflow_id}","v":"${v}"} expected: - eq: {"$.code": 0} api8: title: c端主动发起会话触发workflow ws: customer action: sendmsg sleep: 5 data: type: text api9: title: c端检查是否触发workflow url: /api/v1/chatRecord/customerList method: post data: {"uid":"${customerId}","uType":1,"platform":1,"siteId":"${shopId}","sendTime":0,"pageSize":20,"v":"${customer_v}"} expected: - eq: {"$.code": 0 } - in: {"$.data.list[0].content": "${workflow_update_msg}"} api10: title: 关闭workflow url: /api/v1/rule/updateRuleStatus method: post data: {"status":2,"ruleId":"${create_workflow_id}","v":"${v}"} expected: - eq: {"$.code": 0} api11: title: 删除workflow url: /api/v1/rule/updateRuleStatus method: post data: {"status":3,"ruleId":"${create_workflow_id}","v": "${v}"} expected: - eq: {"$.code": 0} api12: title: 检查是否删除成功 url: /api/v1/rule/ruleList method: post data: {"page":1,"pageSize":100,"brandId":"${brandId}","tplId":"${workflow_parent_template_id}","v":"${v}"} expected: - eq: {"$.code": 0} - eq: {"$.data.total": "${workflow_num_less}"} - not_in_list: {"$.data.ruleList[*].ruleId": "${create_workflow_id}"} api13: title: workflow的object检查 url: /api/v1/rule/ruleObjects method: post data: {"tplId":"${workflow_parent_template_id}","v":"${v}"} before_sql: automation/workflow/workflow_object_select.py expected: - eq: {"$.code": 0} - eq: {"$.data.conditionObjList[?(@.robId == '${condition_id}')].objName": "${condition_name}"} - eq: {"$.data.conditionObjList[?(@.robId == '${condition_id}')].objDescribe": "${condition_describe}"} - eq: {"$.data.conditionObjList[?(@.robId == '${condition_id}')].objCategory": "${condition_category}"} - eq: {"$.data.conditionObjList[?(@.robId == '${condition_id}')].objKind": "${condition_kind}"} - eq: {"$.data.conditionObjList[?(@.robId == '${condition_id}')].objType": "${condition_type}"} - eq: {"$.data.conditionObjList[?(@.robId == '${condition_id}')].parentRobId": "${condition_parent_rob_id}"} - eq: {"$.data.conditionObjList[?(@.robId == '${condition_id}')].showKind": "${condition_show_kind}"} - eq: {"$.data.conditionObjList[?(@.robId == '${condition_id}')].showType": "${condition_show_type}"} - eq: {"$.data.conditionObjList[?(@.robId == '${condition_id}')].valueFrom": "${condition_value_from}"} - exec: {"code": "assert len(res.json()['data']['conditionObjList']) == ${condition_num}"} - eq: {"$.data.resultObjList[?(@.robId == '${result_id}')].objName": "${result_name}"} - eq: {"$.data.resultObjList[?(@.robId == '${result_id}')].objDescribe": "${result_describe}"} - eq: {"$.data.resultObjList[?(@.robId == '${result_id}')].objCategory": "${result_category}"} - eq: {"$.data.resultObjList[?(@.robId == '${result_id}')].objKind": "${result_kind}"} - eq: {"$.data.resultObjList[?(@.robId == '${result_id}')].objType": "${result_type}"} - eq: {"$.data.resultObjList[?(@.robId == '${result_id}')].parentRobId": "${result_parent_rob_id}"} - eq: {"$.data.resultObjList[?(@.robId == '${result_id}')].showKind": "${result_show_kind}"} - eq: {"$.data.resultObjList[?(@.robId == '${result_id}')].showType": "${result_show_type}"} - eq: {"$.data.resultObjList[?(@.robId == '${result_id}')].valueFrom": "${result_value_from}"} - exec: {"code": "assert len(res.json()['data']['resultObjList']) == ${result_num}"} - eq: { "$.data.eventObjList[?(@.robId == '${event_id}')].objName": "${event_name}" } - eq: { "$.data.eventObjList[?(@.robId == '${event_id}')].objDescribe": "${event_describe}" } - eq: { "$.data.eventObjList[?(@.robId == '${event_id}')].objCategory": "${event_category}" } - eq: { "$.data.eventObjList[?(@.robId == '${event_id}')].objKind": "${event_kind}" } - eq: { "$.data.eventObjList[?(@.robId == '${event_id}')].objType": "${event_type}" } - eq: { "$.data.eventObjList[?(@.robId == '${event_id}')].parentRobId": "${event_parent_rob_id}" } - eq: { "$.data.eventObjList[?(@.robId == '${event_id}')].showKind": "${event_show_kind}" } - eq: { "$.data.eventObjList[?(@.robId == '${event_id}')].showType": "${event_show_type}" } - eq: { "$.data.eventObjList[?(@.robId == '${event_id}')].valueFrom": "${event_value_from}" } - exec: { "code": "assert len(res.json()['data']['eventObjList']) == ${event_num}" }