*** Settings ***
Resource          flow_zmx.resource
Resource          res_zmx.resource

*** Variables ***
${path}           /api/v1/ability/update

*** Test Cases ***
正例-正常更新能力
    [Tags]    F
    ${secs1}    Get Time    epoch
    create session    URI    ${URL}
    ${content}    POST请求结果    ${path}    {"id":${bid},"active":true,"name":"outhagent","description":"此能力用于在百度搜索引擎中输入指定的关键词并获取搜索结果。用户只需提供关键词，系统将自动完成搜索操作并返回搜索结果。适用于需要快速获取百度搜索结果的场景。${secs1}","created_at":"2025-08-08T14:51:48","start_page_url":"https://www.baidu.com","parameters":[],"outputs":[],"extensions":{"skipError":false,"useIncognito":false,"closePage":true,"stepInterval":1000,"autoFocus":false}}    200    ${token}
    log    ${content}
    Should Be Equal As Strings    ${content["code"]}    200
    Should Be Equal As Strings    ${content["data"]}    True

反例-不传入token
    [Tags]    E
    ${secs1}    Get Time    epoch
    create session    URI    ${URL}
    ${content}    POST请求结果    ${path}    {"id":${bid},"active":true,"name":"outhagent","description":"此能力用于在百度搜索引擎中输入指定的关键词并获取搜索结果。用户只需提供关键词，系统将自动完成搜索操作并返回搜索结果。适用于需要快速获取百度搜索结果的场景。${secs1}","created_at":"2025-08-08T14:51:48","start_page_url":"https://www.baidu.com","parameters":[],"outputs":[],"extensions":{"skipError":false,"useIncognito":false,"closePage":true,"stepInterval":1000,"autoFocus":false}}    401    ${EMPTY}
    log    ${content}
    Should Be Equal As Strings    ${content["code"]}    401

反例-传入空白token
    [Tags]    E
    ${secs1}    Get Time    epoch
    create session    URI    ${URL}
    ${content}    POST请求结果    ${path}    {"id":${bid},"active":true,"name":"outhagent","description":"此能力用于在百度搜索引擎中输入指定的关键词并获取搜索结果。用户只需提供关键词，系统将自动完成搜索操作并返回搜索结果。适用于需要快速获取百度搜索结果的场景。${secs1}","created_at":"2025-08-08T14:51:48","start_page_url":"https://www.baidu.com","parameters":[],"outputs":[],"extensions":{"skipError":false,"useIncognito":false,"closePage":true,"stepInterval":1000,"autoFocus":false}}    401    {}
    log    ${content}
    Should Be Equal As Strings    ${content["code"]}    401

反例-不传id参数
    [Tags]    E
    ${secs1}    Get Time    epoch
    create session    URI    ${URL}
    ${content}    POST请求结果    ${path}    {"active":true,"name":"outhagent","description":"此能力用于在百度搜索引擎中输入指定的关键词并获取搜索结果。用户只需提供关键词，系统将自动完成搜索操作并返回搜索结果。适用于需要快速获取百度搜索结果的场景。${secs1}","created_at":"2025-08-08T14:51:48","start_page_url":"https://www.baidu.com","parameters":[],"outputs":[],"extensions":{"skipError":false,"useIncognito":false,"closePage":true,"stepInterval":1000,"autoFocus":false}}    422    ${token}
    log    ${content}
    Should Be Equal As Strings    ${content["detail"][0]["type"]}    missing
