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

提交V2.7版本接口测试用例

上级 4218114e
...@@ -8,6 +8,7 @@ ${tenant_code} API_test # 租户号 ...@@ -8,6 +8,7 @@ ${tenant_code} API_test # 租户号
${sa} superAdmin # superAdmin账号 ${sa} superAdmin # superAdmin账号
${URL} http://bitagent.sit.ninetechone.com ${URL} http://bitagent.sit.ninetechone.com
${client_id} a68ad587830d41aebf418a919006353e ${client_id} a68ad587830d41aebf418a919006353e
#M2NMMMNIMMNIM2NL
*** Test Cases *** *** Test Cases ***
token生成 token生成
...@@ -19,8 +20,8 @@ token生成 ...@@ -19,8 +20,8 @@ token生成
Set Global Variable ${zh_token} Bearer ${content["access_token"]} #租户管理员token Set Global Variable ${zh_token} Bearer ${content["access_token"]} #租户管理员token
Set Global Variable ${URL} ${URL} Set Global Variable ${URL} ${URL}
Set Global Variable ${clientId} ${client_id} Set Global Variable ${clientId} ${client_id}
#Set Global Variable ${token} Bearer c48f9c86-74d6-458a-8685-72eb3153ad3f #Set Global Variable ${token} Bearer 9a2814f8-c4ed-4adf-b335-92de7073cd69
#Set Global Variable ${zh_token} Bearer c9cc2c60-a71c-404b-b59a-3fdb6cdbd7a1 #Set Global Variable ${zh_token} Bearer 9354ddac-a4ed-41e4-a709-3b6450ff1e7b
[Teardown] Delete All Sessions [Teardown] Delete All Sessions
*** Keywords *** *** Keywords ***
......
*** Settings ***
Resource flow_zmx.resource
Resource res_zmx.resource
*** Variables ***
${path} /api/v1/ability/steps/original
*** Test Cases ***
正例-获取能力原步骤
[Tags] F
create session URI ${URL}
${content} GET请求结果 ${path} {"ability_id":${bid}} 200 ${token}
log ${content}
Should Be Equal As Strings ${content["code"]} 200
${steps_str} Evaluate json.dumps(${content["data"]})
Set Global Variable ${steps} ${steps_str}
反例-传入空白token
[Tags] E
create session URI ${URL}
${content} GET请求结果 ${path} {"ability_id":${bid}} 401 {}
log ${content}
Should Be Equal As Strings ${content["code"]} 401
反例-不传入token
[Tags] E
create session URI ${URL}
${content} GET请求结果 ${path} {"ability_id":${bid}} 401 ${EMPTY}
log ${content}
Should Be Equal As Strings ${content["code"]} 401
反例-不传ability_id参数
[Tags] E
create session URI ${URL}
${content} GET请求结果 ${path} {} 422 ${token}
log ${content}
Should Be Equal As Strings ${content["detail"][0]["msg"]} Field required
反例-传入无效的ability_id
[Tags] E
create session URI ${URL}
${content} GET请求结果 ${path} {"ability_id":999999} 200 ${token}
log ${content}
Should Be Equal As Strings ${content["code"]} BAE0003
\ No newline at end of file
*** Settings ***
Resource flow_zmx.resource
Resource res_zmx.resource
*** Variables ***
${path} /api/v1/ability/draft/by_steps
${token} 15f43cfa-7ec3-4ca5-a61a-3eec5be4a975
*** Test Cases ***
正例-步骤编辑能力草稿
[Tags] F
create session URI ${URL}
${content} POST请求结果 ${path} {"client_id":"api_test_cid","steps":${steps},"ability_id":${bid}} 200 ${token}
log ${content}
Should Be Equal As Strings ${content["code"]} 200
反例-传入空白token
[Tags] E
create session URI ${URL}
${content} POST请求结果 ${path} {"client_id":"api_test_cid","steps":${steps},"ability_id":${bid}} 401 {}
log ${content}
Should Be Equal As Strings ${content["code"]} 401
反例-不传入token
[Tags] E
create session URI ${URL}
${content} POST请求结果 ${path} {"client_id":"api_test_cid","steps":${steps},"ability_id":${bid}} 401 ${EMPTY}
log ${content}
Should Be Equal As Strings ${content["code"]} 401
反例-不传client_id参数-实际无影响
[Tags] E
create session URI ${URL}
${content} POST请求结果 ${path} {"steps":${steps},"ability_id":${bid}} 200 ${token}
log ${content}
Should Be Equal As Strings ${content["code"]} 200
反例-不传steps参数
[Tags] E
create session URI ${URL}
${content} POST请求结果 ${path} {"client_id":"api_test_cid","ability_id":${bid}} 422 ${token}
log ${content}
Should Be Equal As Strings ${content["detail"][0]["msg"]} Field required
反例-不传ability_id参数
[Tags] E
create session URI ${URL}
${content} POST请求结果 ${path} {"client_id":"api_test_cid","steps":${steps}} 200 ${token}
log ${content}
Should Be Equal As Strings ${content["code"]} BAE0003
反例-传入无效的ability_id
[Tags] E
create session URI ${URL}
${content} POST请求结果 ${path} {"client_id":"api_test_cid","steps":${steps},"ability_id":999999} 200 ${token}
log ${content}
Should Be Equal As Strings ${content["code"]} BAE0003
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论