提交 9ad5ff84 authored 作者: 张孟夏's avatar 张孟夏

添加V2.4版本接口测试用例

上级 321bea7d
*** Settings ***
Resource flow_zmx.resource
Resource res_zmx.resource
Library DateTime
*** Variables ***
${path} /api/v1/plan/create_plan
*** Test Cases ***
正例-正常创建计划
[Tags] F
create session URI ${URL}
${timestamp} Get Time epoch
${plan_name} Catenate SEPARATOR= 接口测试 ${timestamp}
${current_time} Get Current Date
${future_time} Add Time To Date ${current_time} 10 seconds
${formatted_timec} Convert Date ${current_time} result_format=%Y-%m-%dT%H:%M:%S
${formatted_timef} Convert Date ${future_time} result_format=%Y-%m-%dT%H:%M:%S
${content} POST请求结果 ${path} {"name":"${plan_name}","description":"来自接口测试","is_active":true,"ability_id":-1,"executor_type":"client","dispatch_type":"immediate","extensions":{"skipError":false,"useIncognito":false,"closePage":false},"parameters":{"提示":"使用探索工具,打开百度"},"outputs_schema":[{"name":"agent_message","type":"string","description":"探索任务结束后的文字输出"}],"triggers":[{"type":"定时触发器","trigger_type":"date","expression":"${formatted_timef}","is_active":true}],"created_by":"current_user","created_at":"${formatted_timec}"} 200 ${token}
log ${content}
Should Be Equal As Strings ${content["code"]} 200
Set Global Variable ${plan_id} ${content["data"]}
Set Global Variable ${formatted_timec} ${formatted_timec}
Set Global Variable ${formatted_timef} ${formatted_timef}
反例-不传入token
[Tags] E
create session URI ${URL}
${timestamp} Get Time epoch
${plan_name} Catenate SEPARATOR= 接口测试 ${timestamp}
${current_time} Get Current Date
${future_time} Add Time To Date ${current_time} 10 seconds
${formatted_time} Convert Date ${future_time} result_format=%Y-%m-%dT%H:%M:%S
${content} POST请求结果 ${path} {"name":"${plan_name}","description":"1","is_active":true,"ability_id":-1,"executor_type":"client","dispatch_type":"immediate","extensions":{"skipError":false,"useIncognito":false,"closePage":false},"parameters":{"提示":"使用探索工具,打开百度"},"outputs_schema":[{"name":"agent_message","type":"string","description":"探索任务结束后的文字输出"}],"triggers":[{"type":"定时触发器","trigger_type":"date","expression":"${formatted_timef}","is_active":true}],"created_by":"current_user","created_at":"${formatted_timec}"} 401 ${EMPTY}
log ${content}
Should Be Equal As Strings ${content["detail"]} 没有找到认证信息
反例-传入空白token
[Tags] E
create session URI ${URL}
${timestamp} Get Time epoch
${plan_name} Catenate SEPARATOR= 接口测试 ${timestamp}
${current_time} Get Current Date
${future_time} Add Time To Date ${current_time} 10 seconds
${formatted_time} Convert Date ${future_time} result_format=%Y-%m-%dT%H:%M:%S
${content} POST请求结果 ${path} {"name":"${plan_name}","description":"1","is_active":true,"ability_id":-1,"executor_type":"client","dispatch_type":"immediate","extensions":{"skipError":false,"useIncognito":false,"closePage":false},"parameters":{"提示":"使用探索工具,打开百度"},"outputs_schema":[{"name":"agent_message","type":"string","description":"探索任务结束后的文字输出"}],"triggers":[{"type":"定时触发器","trigger_type":"date","expression":"${formatted_timef}","is_active":true}],"created_by":"current_user","created_at":"${formatted_timec}"} 401 {}
log ${content}
Should Be Equal As Strings ${content["detail"]} 无效的access token
反例-不传入name参数
[Tags] E
create session URI ${URL}
${current_time} Get Current Date
${future_time} Add Time To Date ${current_time} 10 seconds
${formatted_time} Convert Date ${future_time} result_format=%Y-%m-%dT%H:%M:%S
${content} POST请求结果 ${path} {"description":"1","is_active":true,"ability_id":-1,"executor_type":"client","dispatch_type":"immediate","extensions":{"skipError":false,"useIncognito":false,"closePage":false},"parameters":{"提示":"使用探索工具,打开百度"},"outputs_schema":[{"name":"agent_message","type":"string","description":"探索任务结束后的文字输出"}],"triggers":[{"type":"定时触发器","trigger_type":"date","expression":"${formatted_timef}","is_active":true}],"created_by":"current_user","created_at":"${formatted_timec}"} 422 ${token}
log ${content}
Should Be Equal As Strings ${content["detail"][0]["type"]} missing
反例-不传入ability_id参数
[Tags] E
create session URI ${URL}
${timestamp} Get Time epoch
${plan_name} Catenate SEPARATOR= 接口测试 ${timestamp}
${current_time} Get Current Date
${future_time} Add Time To Date ${current_time} 10 seconds
${formatted_time} Convert Date ${future_time} result_format=%Y-%m-%dT%H:%M:%S
${content} POST请求结果 ${path} {"name":"${plan_name}","description":"1","is_active":true,"executor_type":"client","dispatch_type":"immediate","extensions":{"skipError":false,"useIncognito":false,"closePage":false},"parameters":{"提示":"使用探索工具,打开百度"},"outputs_schema":[{"name":"agent_message","type":"string","description":"探索任务结束后的文字输出"}],"triggers":[{"type":"定时触发器","trigger_type":"date","expression":"${formatted_timef}","is_active":true}],"created_by":"current_user","created_at":"${formatted_timec}"} 422 ${token}
log ${content}
Should Be Equal As Strings ${content["detail"][0]["type"]} missing
反例-不传入executor_type参数
[Tags] E
create session URI ${URL}
${timestamp} Get Time epoch
${plan_name} Catenate SEPARATOR= 接口测试 ${timestamp}
${current_time} Get Current Date
${future_time} Add Time To Date ${current_time} 10 seconds
${formatted_time} Convert Date ${future_time} result_format=%Y-%m-%dT%H:%M:%S
${content} POST请求结果 ${path} {"name":"${plan_name}","description":"1","is_active":true,"ability_id":-1,"dispatch_type":"immediate","extensions":{"skipError":false,"useIncognito":false,"closePage":false},"parameters":{"提示":"使用探索工具,打开百度"},"outputs_schema":[{"name":"agent_message","type":"string","description":"探索任务结束后的文字输出"}],"triggers":[{"type":"定时触发器","trigger_type":"date","expression":"${formatted_timef}","is_active":true}],"created_by":"current_user","created_at":"${formatted_timec}"} 422 ${token}
log ${content}
Should Be Equal As Strings ${content["detail"][0]["type"]} missing
反例-不传入dispatch_type参数
[Tags] E
create session URI ${URL}
${timestamp} Get Time epoch
${plan_name} Catenate SEPARATOR= 接口测试 ${timestamp}
${current_time} Get Current Date
${future_time} Add Time To Date ${current_time} 10 seconds
${formatted_time} Convert Date ${future_time} result_format=%Y-%m-%dT%H:%M:%S
${content} POST请求结果 ${path} {"name":"${plan_name}","description":"1","is_active":true,"ability_id":-1,"executor_type":"client","extensions":{"skipError":false,"useIncognito":false,"closePage":false},"parameters":{"提示":"使用探索工具,打开百度"},"outputs_schema":[{"name":"agent_message","type":"string","description":"探索任务结束后的文字输出"}],"triggers":[{"type":"定时触发器","trigger_type":"date","expression":"${formatted_timef}","is_active":true}],"created_by":"current_user","created_at":"${formatted_timec}"} 422 ${token}
log ${content}
Should Be Equal As Strings ${content["detail"][0]["type"]} missing
\ No newline at end of file
*** Settings ***
Resource flow_zmx.resource
Resource res_zmx.resource
*** Variables ***
${path} /api/v1/plan/page
*** Test Cases ***
正例-获取计划列表
[Tags] F
create session URI ${URL}
${content} POST请求结果 ${path} {"page":1,"page_size":20} 200 ${token}
log ${content}
Should Be Equal As Strings ${content["code"]} 200
Should Be Equal As Strings ${content["data"][0]["id"]} ${plan_id}
反例-不传入token
[Tags] E
create session URI ${URL}
${content} POST请求结果 ${path} {"page":1,"page_size":20} 401 ${EMPTY}
log ${content}
Should Be Equal As Strings ${content["detail"]} 没有找到认证信息
反例-传入空白token
[Tags] E
create session URI ${URL}
${content} POST请求结果 ${path} {"page":1,"page_size":20} 401 {}
log ${content}
Should Be Equal As Strings ${content["detail"]} 无效的access token
\ No newline at end of file
*** Settings ***
Resource flow_zmx.resource
Resource res_zmx.resource
Library Telnet
*** Variables ***
${path} /api/v1/plan/plan_details
*** Test Cases ***
正例-查看计划详情
[Tags] F
create session URI ${URL}
${content} GET请求结果 ${path}/${plan_id} {} 200 ${token}
log ${content}
Should Be Equal As Strings ${content["code"]} 200
Should Be Equal As Strings ${content["data"]["id"]} ${plan_id}
Set Global Variable ${trigger_id1} ${content["data"]["triggers"][0]["id"]}
反例-不传入token
[Tags] E
create session URI ${URL}
${content} GET请求结果 ${path}/${plan_id} {} 401 ${EMPTY}
log ${content}
Should Be Equal As Strings ${content["detail"]} 没有找到认证信息
反例-传入空白token
[Tags] E
create session URI ${URL}
${content} GET请求结果 ${path}/${plan_id} {} 401 {}
log ${content}
Should Be Equal As Strings ${content["detail"]} 无效的access token
\ No newline at end of file
*** Settings ***
Resource flow_zmx.resource
Resource res_zmx.resource
*** Variables ***
${path} /api/v1/plan/inactive_plan
*** Test Cases ***
正例-禁用计划
[Tags] F
create session URI ${URL}
# 构建带计划ID的完整路径
${inactive_path} Catenate SEPARATOR=/ ${path} ${plan_id}
${content} POST请求结果 ${inactive_path} {} 200 ${token}
log ${content}
Should Be Equal As Strings ${content["code"]} 200
反例-不传入token
[Tags] E
create session URI ${URL}
${inactive_path} Catenate SEPARATOR=/ ${path} ${plan_id}
${content} POST请求结果 ${inactive_path} {} 401 ${EMPTY}
log ${content}
Should Be Equal As Strings ${content["detail"]} 没有找到认证信息
反例-传入空白token
[Tags] E
create session URI ${URL}
${inactive_path} Catenate SEPARATOR=/ ${path} ${plan_id}
${content} POST请求结果 ${inactive_path} {} 401 {}
log ${content}
Should Be Equal As Strings ${content["detail"]} 无效的access token
*** Settings ***
Resource flow_zmx.resource
Resource res_zmx.resource
*** Variables ***
${path} /api/v1/plan/active_plan
*** Test Cases ***
正例-启用计划
[Tags] F
create session URI ${URL}
# 构建带计划ID的完整路径
${active_path} Catenate SEPARATOR=/ ${path} ${plan_id}
${content} POST请求结果 ${active_path} {} 200 ${token}
log ${content}
Should Be Equal As Strings ${content["code"]} 200
反例-不传入token
[Tags] E
create session URI ${URL}
${active_path} Catenate SEPARATOR=/ ${path} ${plan_id}
${content} POST请求结果 ${active_path} {} 401 ${EMPTY}
log ${content}
Should Be Equal As Strings ${content["detail"]} 没有找到认证信息
反例-传入空白token
[Tags] E
create session URI ${URL}
${active_path} Catenate SEPARATOR=/ ${path} ${plan_id}
${content} POST请求结果 ${active_path} {} 401 {}
log ${content}
Should Be Equal As Strings ${content["detail"]} 无效的access token
\ No newline at end of file
*** Settings ***
Resource flow_zmx.resource
Resource res_zmx.resource
*** Variables ***
${path} /api/v1/plan/update_plan
*** Test Cases ***
正例-正常修改计划
[Tags] F
create session URI ${URL}
${timestamp} Get Time epoch
${plan_name} Catenate SEPARATOR= 接口测试 ${timestamp}
${content} PUT请求结果_json ${path} {"name":"${plan_name}","description":"来自接口测试,并修改计划","is_active":true,"ability_id":-1,"executor_type":"client","dispatch_type":"immediate","extensions":{"useIncognito":false,"autoFocus":false,"closePage":false},"parameters":{"提示":"使用探索工具,打开百度"},"outputs_schema":[{"name":"agent_message","type":"string","description":"探索任务结束后的文字输出"}],"triggers":[{"key":"0","id":"${trigger_id1}","type":"定时触发器","trigger_type":"date","expression":"${formatted_timef}","start_time":"","end_time":"","is_active":true,"description":"","translation":"","originalData":{"id":${trigger_id1},"type":"定时触发器","trigger_type":"date","expression":"${formatted_timef}","start_time":null,"end_time":null,"is_active":true,"created_at":"${formatted_timec}","update_at":null,"next_run_time":"${formatted_timef}"},"hasChanges":false}],"id":${plan_id}} 200 ${token}
log ${content}
Should Be Equal As Strings ${content["code"]} 200
反例-不传入token
[Tags] E
create session URI ${URL}
${timestamp} Get Time epoch
${plan_name} Catenate SEPARATOR= 接口测试 ${timestamp}
${content} PUT请求结果_json ${path} {"name":"${plan_name}","description":"来自接口测试,并修改计划","is_active":true,"ability_id":-1,"executor_type":"client","dispatch_type":"immediate","extensions":{"useIncognito":false,"autoFocus":false,"closePage":false},"parameters":{"提示":"使用探索工具,打开百度"},"outputs_schema":[{"name":"agent_message","type":"string","description":"探索任务结束后的文字输出"}],"triggers":[{"key":"0","id":"${trigger_id1}","type":"定时触发器","trigger_type":"date","expression":"${formatted_timef}","start_time":"","end_time":"","is_active":true,"description":"","translation":"","originalData":{"id":${trigger_id1},"type":"定时触发器","trigger_type":"date","expression":"${formatted_timef}","start_time":null,"end_time":null,"is_active":true,"created_at":"${formatted_timec}","update_at":null,"next_run_time":"${formatted_timef}"},"hasChanges":false}],"id":${plan_id}} 401 ${EMPTY}
log ${content}
Should Be Equal As Strings ${content["detail"]} 没有找到认证信息
反例-传入空白token
[Tags] E
create session URI ${URL}
${timestamp} Get Time epoch
${plan_name} Catenate SEPARATOR= 接口测试 ${timestamp}
${content} PUT请求结果_json ${path} {"name":"${plan_name}","description":"来自接口测试,并修改计划","is_active":true,"ability_id":-1,"executor_type":"client","dispatch_type":"immediate","extensions":{"useIncognito":false,"autoFocus":false,"closePage":false},"parameters":{"提示":"使用探索工具,打开百度"},"outputs_schema":[{"name":"agent_message","type":"string","description":"探索任务结束后的文字输出"}],"triggers":[{"key":"0","id":"${trigger_id1}","type":"定时触发器","trigger_type":"date","expression":"${formatted_timef}","start_time":"","end_time":"","is_active":true,"description":"","translation":"","originalData":{"id":${trigger_id1},"type":"定时触发器","trigger_type":"date","expression":"${formatted_timef}","start_time":null,"end_time":null,"is_active":true,"created_at":"${formatted_timec}","update_at":null,"next_run_time":"${formatted_timef}"},"hasChanges":false}],"id":${plan_id}} 401 {}
log ${content}
Should Be Equal As Strings ${content["detail"]} 无效的access token
反例-不传入name参数
[Tags] E
create session URI ${URL}
${content} PUT请求结果_json ${path} {"description":"来自接口测试,并修改计划","is_active":true,"ability_id":-1,"executor_type":"client","dispatch_type":"immediate","extensions":{"useIncognito":false,"autoFocus":false,"closePage":false},"parameters":{"提示":"使用探索工具,打开百度"},"outputs_schema":[{"name":"agent_message","type":"string","description":"探索任务结束后的文字输出"}],"triggers":[{"key":"0","id":"${trigger_id1}","type":"定时触发器","trigger_type":"date","expression":"${formatted_timef}","start_time":"","end_time":"","is_active":true,"description":"","translation":"","originalData":{"id":${trigger_id1},"type":"定时触发器","trigger_type":"date","expression":"${formatted_timef}","start_time":null,"end_time":null,"is_active":true,"created_at":"${formatted_timec}","update_at":null,"next_run_time":"${formatted_timef}"},"hasChanges":false}],"id":${plan_id}} 422 ${token}
log ${content}
Should Be Equal As Strings ${content["detail"][0]["type"]} missing
反例-不传入id参数
[Tags] E
create session URI ${URL}
${timestamp} Get Time epoch
${plan_name} Catenate SEPARATOR= 接口测试 ${timestamp}
${content} PUT请求结果_json ${path} {"name":"${plan_name}","description":"来自接口测试,并修改计划","is_active":true,"ability_id":-1,"executor_type":"client","dispatch_type":"immediate","extensions":{"useIncognito":false,"autoFocus":false,"closePage":false},"parameters":{"提示":"使用探索工具,打开百度"},"outputs_schema":[{"name":"agent_message","type":"string","description":"探索任务结束后的文字输出"}],"triggers":[{"key":"0","id":"${trigger_id1}","type":"定时触发器","trigger_type":"date","expression":"${formatted_timef}","start_time":"","end_time":"","is_active":true,"description":"","translation":"","originalData":{"id":${trigger_id1},"type":"定时触发器","trigger_type":"date","expression":"${formatted_timef}","start_time":null,"end_time":null,"is_active":true,"created_at":"${formatted_timec}","update_at":null,"next_run_time":"${formatted_timef}"},"hasChanges":false}]} 422 ${token}
log ${content}
Should Be Equal As Strings ${content["detail"][0]["type"]} missing
\ No newline at end of file
*** Settings ***
Resource flow_zmx.resource
Resource res_zmx.resource
*** Variables ***
${path} /api/v1/plan/plan_task
*** Test Cases ***
正例-正常获取计划任务列表
[Tags] F
create session URI ${URL}
${content} POST请求结果 ${path} {"page_index":0,"page_size":10,"plan_id":"${plan_id}"} 200 ${token}
log ${content}
Should Be Equal As Strings ${content["code"]} 200
反例-不传入token
[Tags] E
create session URI ${URL}
${content} POST请求结果 ${path} {"page_index":0,"page_size":10,"plan_id":"${plan_id}"} 401 ${EMPTY}
log ${content}
Should Be Equal As Strings ${content["detail"]} 没有找到认证信息
反例-传入空白token
[Tags] E
create session URI ${URL}
${content} POST请求结果 ${path} {"page_index":0,"page_size":10,"plan_id":"${plan_id}"} 401 {}
log ${content}
Should Be Equal As Strings ${content["detail"]} 无效的access token
*** Settings ***
Resource flow_zmx.resource
Resource res_zmx.resource
Library DateTime
*** Variables ***
${path} /api/v1/plan/add_trigger
*** Test Cases ***
正例-正常添加计划触发器
[Tags] F
create session URI ${URL}
${current_time} Get Current Date
${future_time} Add Time To Date ${current_time} 30 seconds
${formatted_time} Convert Date ${future_time} result_format=%Y-%m-%dT%H:%M:%S
${content} POST请求结果 ${path} {"plan_id":"${plan_id}","trigger":{"type":"定时触发器","trigger_type":"date","expression":"${formatted_time}","is_active":true}} 200 ${token}
log ${content}
Should Be Equal As Strings ${content["code"]} 200
Set Global Variable ${trigger_id} ${content["data"]}
反例-不传入token
[Tags] E
create session URI ${URL}
${content} POST请求结果 ${path} {"plan_id":"${plan_id}","trigger":{"type":"定时触发器","trigger_type":"date","expression":"2025-09-05T16:23:45","is_active":true}} 401 ${EMPTY}
log ${content}
Should Be Equal As Strings ${content["detail"]} 没有找到认证信息
反例-传入空白token
[Tags] E
create session URI ${URL}
${content} POST请求结果 ${path} {"plan_id":"${plan_id}","trigger":{"type":"定时触发器","trigger_type":"date","expression":"2025-09-05T16:23:45","is_active":true}} 401 {}
log ${content}
Should Be Equal As Strings ${content["detail"]} 无效的access token
反例-不传入plan_id参数
[Tags] E
create session URI ${URL}
${content} POST请求结果 ${path} {"trigger":{"type":"定时触发器","trigger_type":"date","expression":"2025-09-05T16:23:45","is_active":true}} 422 ${token}
log ${content}
Should Be Equal As Strings ${content["detail"][0]["type"]} missing
反例-不传入trigger参数
[Tags] E
create session URI ${URL}
${content} POST请求结果 ${path} {"plan_id":"${plan_id}"} 422 ${token}
log ${content}
Should Be Equal As Strings ${content["detail"][0]["type"]} missing
\ No newline at end of file
*** Settings ***
Resource flow_zmx.resource
Resource res_zmx.resource
Library DateTime
*** Variables ***
${path} /api/v1/plan/update_trigger
*** Test Cases ***
正例-正常更新计划触发器
[Tags] F
create session URI ${URL}
${current_time} Get Current Date
${future_time} Add Time To Date ${current_time} 30 days
${formatted_timec} Convert Date ${current_time} result_format=%Y-%m-%dT%H:%M:%S
${formatted_timef} Convert Date ${future_time} result_format=%Y-%m-%dT%H:%M:%S
${content} POST请求结果 ${path} {"type":"定时触发器","trigger_type":"cron","expression":"0 9 * * *","start_time":"${formatted_timec}","end_time":"${formatted_timef}","is_active":true,"plan_id":${plan_id},"trigger_id":${trigger_id}} 200 ${token}
log ${content}
Should Be Equal As Strings ${content["code"]} 200
Should Be Equal As Strings ${content["data"]} ${trigger_id}
反例-不传入token
[Tags] E
create session URI ${URL}
${content} POST请求结果 ${path} {"type":"定时触发器","trigger_type":"cron","expression":"0 9 * * *","start_time":"2025-09-05T00:00:00","end_time":"2025-10-05T00:00:00","is_active":true,"plan_id":${plan_id},"trigger_id":${trigger_id}} 401 ${EMPTY}
log ${content}
Should Be Equal As Strings ${content["detail"]} 没有找到认证信息
反例-传入空白token
[Tags] E
create session URI ${URL}
${content} POST请求结果 ${path} {"type":"定时触发器","trigger_type":"cron","expression":"0 9 * * *","start_time":"2025-09-05T00:00:00","end_time":"2025-10-05T00:00:00","is_active":true,"plan_id":${plan_id},"trigger_id":${trigger_id}} 401 {}
log ${content}
Should Be Equal As Strings ${content["detail"]} 无效的access token
反例-不传入plan_id参数
[Tags] E
create session URI ${URL}
${content} POST请求结果 ${path} {"type":"定时触发器","trigger_type":"cron","expression":"0 9 * * *","start_time":"2025-09-05T00:00:00","end_time":"2025-10-05T00:00:00","is_active":true,"trigger_id":${trigger_id}} 422 ${token}
log ${content}
Should Be Equal As Strings ${content["detail"][0]["type"]} missing
反例-不传入trigger_id参数
[Tags] E
create session URI ${URL}
${content} POST请求结果 ${path} {"type":"定时触发器","trigger_type":"cron","expression":"0 9 * * *","start_time":"2025-09-05T00:00:00","end_time":"2025-10-05T00:00:00","is_active":true,"plan_id":${plan_id}} 422 ${token}
log ${content}
Should Be Equal As Strings ${content["detail"][0]["type"]} missing
\ No newline at end of file
*** Settings ***
Resource flow_zmx.resource
Resource res_zmx.resource
*** Variables ***
${path} /api/v1/plan/delete_trigger
*** Test Cases ***
正例-正常删除计划触发器
[Tags] F
create session URI ${URL}
${content} POST请求结果 ${path} {"plan_id":"${plan_id}","trigger_id":"${trigger_id}"} 200 ${token}
log ${content}
Should Be Equal As Strings ${content["code"]} 200
反例-不传入token
[Tags] E
create session URI ${URL}
${content} POST请求结果 ${path} {"plan_id":"${plan_id}","trigger_id":"${trigger_id}"} 401 ${EMPTY}
log ${content}
Should Be Equal As Strings ${content["detail"]} 没有找到认证信息
反例-传入空白token
[Tags] E
create session URI ${URL}
${content} POST请求结果 ${path} {"plan_id":"${plan_id}","trigger_id":"${trigger_id}"} 401 {}
log ${content}
Should Be Equal As Strings ${content["detail"]} 无效的access token
反例-不传入plan_id参数
[Tags] E
create session URI ${URL}
${content} POST请求结果 ${path} {"trigger_id":"${trigger_id}"} 422 ${token}
log ${content}
Should Be Equal As Strings ${content["detail"][0]["type"]} missing
反例-不传入trigger_id参数
[Tags] E
create session URI ${URL}
${content} POST请求结果 ${path} {"plan_id":"${plan_id}"} 422 ${token}
log ${content}
Should Be Equal As Strings ${content["detail"][0]["type"]} missing
\ No newline at end of file
*** Settings ***
Resource flow_zmx.resource
Resource res_zmx.resource
*** Variables ***
${path} /api/v1/plan/delete_plan
*** Test Cases ***
正例-正常删除计划
[Tags] F
create session URI ${URL}
${content} DEL请求结果 ${path}/${plan_id} {} 200 ${token}
log ${content}
Should Be Equal As Strings ${content["code"]} 200
反例-不传入token
[Tags] E
create session URI ${URL}
${content} DEL请求结果 ${path}/${plan_id} {} 401 ${EMPTY}
log ${content}
Should Be Equal As Strings ${content["detail"]} 没有找到认证信息
反例-传入空白token
[Tags] E
create session URI ${URL}
${content} DEL请求结果 ${path}/${plan_id} {} 401 {}
log ${content}
Should Be Equal As Strings ${content["detail"]} 无效的access token
反例-不传入plan_id
[Tags] E
create session URI ${URL}
${content} DEL请求结果 ${path}/ {} 404 ${token}
log ${content}
*** Settings ***
Resource flow_zmx.resource
Resource res_zmx.resource
*** Variables ***
${path} /api/v1/plan/generate_cron
*** Test Cases ***
正例-正常生成cron表达式(每天上午9点)
[Tags] F
create session URI ${URL}
${content} POST请求结果 ${path} {"user_input":"每天上午9点执行一次"} 200 ${token}
log ${content}
Should Be Equal As Strings ${content["code"]} 200
正例-正常生成cron表达式(每周一执行)
[Tags] F
create session URI ${URL}
${content} POST请求结果 ${path} {"user_input":"每周一执行一次"} 200 ${token}
log ${content}
Should Be Equal As Strings ${content["code"]} 200
反例-不传入token
[Tags] E
create session URI ${URL}
${content} POST请求结果 ${path} {"user_input":"每天上午9点执行一次"} 401 ${EMPTY}
log ${content}
Should Be Equal As Strings ${content["detail"]} 没有找到认证信息
反例-传入空白token
[Tags] E
create session URI ${URL}
${content} POST请求结果 ${path} {"user_input":"每天上午9点执行一次"} 401 {}
log ${content}
Should Be Equal As Strings ${content["detail"]} 无效的access token
反例-不传入user_input参数
[Tags] E
create session URI ${URL}
${content} POST请求结果 ${path} {} 422 ${token}
log ${content}
Should Be Equal As Strings ${content["detail"][0]["type"]} missing
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论