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

*** Variables ***
${path}           /api/explore_client/create

*** Test Cases ***
正例-正常创建客户端探索会话session
    [Tags]    F
    create session    URI    ${URL}
    ${content}    POST请求结果_params    ${path}    {"workerId":"${clientId}"}    200    ${token}
    log    ${content}
    Should Be Equal As Strings    ${content["code"]}    200
    Set Global Variable    ${EXPCsessionId}    ${content["data"]["sessionId"]}

反例-传入无效的token
    [Tags]    E
    create session    URI    ${URL}
    ${content}    POST请求结果_params    ${path}    {"workerId":"${clientId}"}    401    {}
    log    ${content}
    Should Be Equal As Strings    ${content["code"]}    401

反例-不传入workerId
    [Tags]    E
    create session    URI    ${URL}
    ${content}    POST请求结果_params    ${path}    {}    422    ${token}
    log    ${content}
    Should Be Equal As Strings    ${content["detail"][0]["msg"]}    Field required

反例-传入空白token
    [Tags]    E
    create session    URI    ${URL}
    ${content}    POST请求结果_params    ${path}    {"workerId":"${clientId}"}    401    ${EMPTY}
    log    ${content}
    Should Be Equal As Strings    ${content["code"]}    401
