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

提交V3.4版本修改的接口

上级 7b8ff7c4
...@@ -19,6 +19,18 @@ ${jpg_file} testpicture.jpg ...@@ -19,6 +19,18 @@ ${jpg_file} testpicture.jpg
Should Be Equal As Strings ${content["code"]} 200 Should Be Equal As Strings ${content["code"]} 200
Set Global Variable ${common_file_id} ${content["data"]["id"]} Set Global Variable ${common_file_id} ${content["data"]["id"]}
正例-上传文件并传入client_local_path
[Tags] F
create session URI ${URL}
${file} Evaluate (r'${jpg_file}', open(r'${CURDIR}${/}..${/}testfiles${/}${jpg_file}', 'rb'))
${header} Create Dictionary Authorization=${token}
${files} Create Dictionary file=${file}
${params} Create Dictionary client_local_path=/local/path/testpicture.jpg
${resp} Post On Session URI ${path} files=${files} headers=${header} params=${params}
${content} Set Variable ${resp.json()}
log ${content}
Should Be Equal As Strings ${content["code"]} 200
反例-不传入token 反例-不传入token
[Tags] E [Tags] E
create session URI ${URL} create session URI ${URL}
...@@ -34,7 +46,7 @@ ${jpg_file} testpicture.jpg ...@@ -34,7 +46,7 @@ ${jpg_file} testpicture.jpg
[Tags] E [Tags] E
create session URI ${URL} create session URI ${URL}
${file} Evaluate (r'${jpg_file}', open(r'${CURDIR}${/}..${/}testfiles${/}${jpg_file}', 'rb')) ${file} Evaluate (r'${jpg_file}', open(r'${CURDIR}${/}..${/}testfiles${/}${jpg_file}', 'rb'))
${header} Create Dictionary Authorization={} ${header} Create Dictionary Authorization=
${files} Create Dictionary file=${file} ${files} Create Dictionary file=${file}
${resp} Post On Session URI ${path} files=${files} headers=${header} expected_status=401 ${resp} Post On Session URI ${path} files=${files} headers=${header} expected_status=401
${content} Set Variable ${resp.json()} ${content} Set Variable ${resp.json()}
......
...@@ -13,7 +13,10 @@ ${path} /api/v3/payment/products ...@@ -13,7 +13,10 @@ ${path} /api/v3/payment/products
log ${content} log ${content}
Should Be Equal As Strings ${content["code"]} 200 Should Be Equal As Strings ${content["code"]} 200
Should Contain ${content} data Should Contain ${content} data
Set Global Variable ${product_code} basic_monthly ${first_product} Set Variable ${content["data"][0]}
Set Global Variable ${sku_id} ${first_product["sku_id"]}
Set Global Variable ${spu_id} ${first_product["spu_id"]}
Set Global Variable ${price_cents} ${first_product["price_cents"]}
反例-传入无效token 反例-传入无效token
[Tags] E [Tags] E
......
...@@ -8,6 +8,7 @@ ${path} /api/v3/payment/order ...@@ -8,6 +8,7 @@ ${path} /api/v3/payment/order
*** Test Cases *** *** Test Cases ***
正例-创建订单 正例-创建订单
[Tags] F [Tags] F
Skip 跳过此条
create session URI ${URL} create session URI ${URL}
${content} POST请求结果 ${path} {"product_code":"${product_code}"} 200 ${zh_token} ${content} POST请求结果 ${path} {"product_code":"${product_code}"} 200 ${zh_token}
log ${content} log ${content}
...@@ -17,6 +18,7 @@ ${path} /api/v3/payment/order ...@@ -17,6 +18,7 @@ ${path} /api/v3/payment/order
正例-创建订单指定渠道 正例-创建订单指定渠道
[Tags] F [Tags] F
Skip 跳过此条
create session URI ${URL} create session URI ${URL}
${content} POST请求结果 ${path} {"product_code":"${product_code}","channel":"wechat"} 200 ${zh_token} ${content} POST请求结果 ${path} {"product_code":"${product_code}","channel":"wechat"} 200 ${zh_token}
log ${content} log ${content}
...@@ -24,6 +26,7 @@ ${path} /api/v3/payment/order ...@@ -24,6 +26,7 @@ ${path} /api/v3/payment/order
反例-不传入product_code 反例-不传入product_code
[Tags] E [Tags] E
Skip 跳过此条
create session URI ${URL} create session URI ${URL}
${content} POST请求结果 ${path} {} 422 ${zh_token} ${content} POST请求结果 ${path} {} 422 ${zh_token}
log ${content} log ${content}
...@@ -31,6 +34,7 @@ ${path} /api/v3/payment/order ...@@ -31,6 +34,7 @@ ${path} /api/v3/payment/order
反例-传入无效token 反例-传入无效token
[Tags] E [Tags] E
Skip 跳过此条
create session URI ${URL} create session URI ${URL}
${content} POST请求结果 ${path} {"product_code":"${product_code}"} 401 {} ${content} POST请求结果 ${path} {"product_code":"${product_code}"} 401 {}
log ${content} log ${content}
......
*** Settings *** *** Settings ***
Resource ../flow_zmx.resource Resource ../flow_zmx.resource
Resource ../res_zmx.resource Resource ../res_zmx.resource
Force Tags SKIP
*** Variables *** *** Variables ***
${path} /api/v3/payment/order ${path} /api/v3/payment/order
...@@ -8,6 +9,7 @@ ${path} /api/v3/payment/order ...@@ -8,6 +9,7 @@ ${path} /api/v3/payment/order
*** Test Cases *** *** Test Cases ***
正例-查询订单状态 正例-查询订单状态
[Tags] F [Tags] F
Skip 跳过此条
create session URI ${URL} create session URI ${URL}
${content} GET请求结果 ${path}/${order_no} {} 200 ${zh_token} ${content} GET请求结果 ${path}/${order_no} {} 200 ${zh_token}
log ${content} log ${content}
...@@ -16,6 +18,7 @@ ${path} /api/v3/payment/order ...@@ -16,6 +18,7 @@ ${path} /api/v3/payment/order
反例-查询不存在的订单 反例-查询不存在的订单
[Tags] E [Tags] E
Skip 跳过此条
create session URI ${URL} create session URI ${URL}
${content} GET请求结果 ${path}/invalid_order_no {} 200 ${zh_token} ${content} GET请求结果 ${path}/invalid_order_no {} 200 ${zh_token}
log ${content} log ${content}
...@@ -23,6 +26,7 @@ ${path} /api/v3/payment/order ...@@ -23,6 +26,7 @@ ${path} /api/v3/payment/order
反例-传入无效token 反例-传入无效token
[Tags] E [Tags] E
Skip 跳过此条
create session URI ${URL} create session URI ${URL}
${content} GET请求结果 ${path}/${order_no} {} 401 {} ${content} GET请求结果 ${path}/${order_no} {} 401 {}
log ${content} log ${content}
......
*** Settings *** *** Settings ***
Resource ../flow_zmx.resource Resource ../flow_zmx.resource
Resource ../res_zmx.resource Resource ../res_zmx.resource
Force Tags SKIP
*** Variables *** *** Variables ***
${path} /api/v3/payment/orders ${path} /api/v3/payment/orders
...@@ -8,6 +9,7 @@ ${path} /api/v3/payment/orders ...@@ -8,6 +9,7 @@ ${path} /api/v3/payment/orders
*** Test Cases *** *** Test Cases ***
正例-获取订单列表 正例-获取订单列表
[Tags] F [Tags] F
Skip 跳过此条
create session URI ${URL} create session URI ${URL}
${content} GET请求结果 ${path} {} 200 ${zh_token} ${content} GET请求结果 ${path} {} 200 ${zh_token}
log ${content} log ${content}
...@@ -16,6 +18,7 @@ ${path} /api/v3/payment/orders ...@@ -16,6 +18,7 @@ ${path} /api/v3/payment/orders
正例-按状态筛选订单 正例-按状态筛选订单
[Tags] F [Tags] F
Skip 跳过此条
create session URI ${URL} create session URI ${URL}
${content} GET请求结果 ${path} {"status":"paid"} 200 ${zh_token} ${content} GET请求结果 ${path} {"status":"paid"} 200 ${zh_token}
log ${content} log ${content}
...@@ -23,13 +26,23 @@ ${path} /api/v3/payment/orders ...@@ -23,13 +26,23 @@ ${path} /api/v3/payment/orders
正例-分页查询 正例-分页查询
[Tags] F [Tags] F
Skip 跳过此条
create session URI ${URL} create session URI ${URL}
${content} GET请求结果 ${path} {"page":1,"page_size":10} 200 ${zh_token} ${content} GET请求结果 ${path} {"page_no":1,"page_size":10} 200 ${zh_token}
log ${content}
Should Be Equal As Strings ${content["code"]} 200
正例-关键词过滤
[Tags] F
Skip 跳过此条
create session URI ${URL}
${content} GET请求结果 ${path} {"filter":"test"} 200 ${zh_token}
log ${content} log ${content}
Should Be Equal As Strings ${content["code"]} 200 Should Be Equal As Strings ${content["code"]} 200
反例-传入无效token 反例-传入无效token
[Tags] E [Tags] E
Skip 跳过此条
create session URI ${URL} create session URI ${URL}
${content} GET请求结果 ${path} {} 401 {} ${content} GET请求结果 ${path} {} 401 {}
log ${content} log ${content}
......
*** Settings *** *** Settings ***
Resource ../flow_zmx.resource Resource ../flow_zmx.resource
Resource ../res_zmx.resource Resource ../res_zmx.resource
Force Tags SKIP
*** Variables *** *** Variables ***
${path} /api/v3/payment/order ${path} /api/v3/payment/order
...@@ -8,6 +9,7 @@ ${path} /api/v3/payment/order ...@@ -8,6 +9,7 @@ ${path} /api/v3/payment/order
*** Test Cases *** *** Test Cases ***
正例-关闭订单 正例-关闭订单
[Tags] F [Tags] F
Skip 跳过此条
create session URI ${URL} create session URI ${URL}
${content} POST请求结果 ${path}/${order_no}/close {} 200 ${zh_token} ${content} POST请求结果 ${path}/${order_no}/close {} 200 ${zh_token}
log ${content} log ${content}
...@@ -15,6 +17,7 @@ ${path} /api/v3/payment/order ...@@ -15,6 +17,7 @@ ${path} /api/v3/payment/order
反例-关闭不存在的订单 反例-关闭不存在的订单
[Tags] E [Tags] E
Skip 跳过此条
create session URI ${URL} create session URI ${URL}
${content} POST请求结果 ${path}/invalid_order_no/close {} 200 ${zh_token} ${content} POST请求结果 ${path}/invalid_order_no/close {} 200 ${zh_token}
log ${content} log ${content}
...@@ -22,6 +25,7 @@ ${path} /api/v3/payment/order ...@@ -22,6 +25,7 @@ ${path} /api/v3/payment/order
反例-传入无效token 反例-传入无效token
[Tags] E [Tags] E
Skip 跳过此条
create session URI ${URL} create session URI ${URL}
${content} POST请求结果 ${path}/${order_no}/close {} 401 {} ${content} POST请求结果 ${path}/${order_no}/close {} 401 {}
log ${content} log ${content}
......
*** Settings ***
Resource ../flow_zmx.resource
Resource ../res_zmx.resource
*** Variables ***
${path} /api/v3/payment/order-prepay
*** Test Cases ***
正例-订单预支付
[Tags] F
create session URI ${URL}
${body} Evaluate json.dumps({"skuList":[{"skuId":${sku_id},"spuId":${spu_id},"num":1}],"totalPrice":${price_cents},"channel":1}) json
${content} POST请求结果 ${path} ${body} 200 ${zh_token}
log ${content}
Should Be Equal As Strings ${content["code"]} 200
Should Contain ${content["data"]} order
Should Contain ${content["data"]} prepay
Should Contain ${content["data"]["prepay"]} attachment
Set Global Variable ${order_no} ${content["data"]["order"]["parent_order_no"]}
正例-指定微信支付渠道
[Tags] F
create session URI ${URL}
${body} Evaluate json.dumps({"skuList":[{"skuId":${sku_id},"spuId":${spu_id},"num":1}],"totalPrice":${price_cents},"channel":2}) json
${content} POST请求结果 ${path} ${body} 200 ${zh_token}
log ${content}
Should Be Equal As Strings ${content["code"]} 200
反例-不传入skuList
[Tags] E
create session URI ${URL}
${content} POST请求结果 ${path} {"totalPrice":${price_cents},"channel":1} 422 ${zh_token}
log ${content}
Should Contain ${content} detail
反例-不传入totalPrice
[Tags] E
create session URI ${URL}
${body} Evaluate json.dumps({"skuList":[{"skuId":${sku_id},"spuId":${spu_id},"num":1}],"channel":1}) json
${content} POST请求结果 ${path} ${body} 422 ${zh_token}
log ${content}
Should Contain ${content} detail
反例-传入无效token
[Tags] E
create session URI ${URL}
${body} Evaluate json.dumps({"skuList":[{"skuId":${sku_id},"spuId":${spu_id},"num":1}],"totalPrice":${price_cents},"channel":1}) json
${content} POST请求结果 ${path} ${body} 401 {}
log ${content}
Should Be Equal As Strings ${content["code"]} 401
反例-传入空skuList
[Tags] E
create session URI ${URL}
${content} POST请求结果 ${path} {"skuList":[],"totalPrice":${price_cents},"channel":1} 422 ${zh_token}
log ${content}
Should Contain ${content} detail
*** Settings ***
Resource ../flow_zmx.resource
Resource ../res_zmx.resource
*** Variables ***
${path} /api/v3/payment/fulfillment-status
*** Test Cases ***
正例-查询履约状态
[Tags] F
create session URI ${URL}
${content} GET请求结果 ${path} {"parent_order_no":"${order_no}"} 200 ${zh_token}
log ${content}
Should Be Equal As Strings ${content["code"]} 200
Should Contain ${content["data"]} status
Should Contain ${content["data"]} parent_order_no
反例-不传入parent_order_no
[Tags] E
create session URI ${URL}
${content} GET请求结果 ${path} {} 422 ${zh_token}
log ${content}
Should Contain ${content} detail
反例-传入不存在的订单号
[Tags] E
create session URI ${URL}
${content} GET请求结果 ${path} {"parent_order_no":"invalid_order_no"} 200 ${zh_token}
log ${content}
Should Be Equal As Strings ${content["code"]} 200
反例-传入无效token
[Tags] E
create session URI ${URL}
${content} GET请求结果 ${path} {"parent_order_no":"${order_no}"} 401 {}
log ${content}
Should Be Equal As Strings ${content["code"]} 401
*** Settings ***
Resource ../flow_zmx.resource
Resource ../res_zmx.resource
*** Variables ***
${path} /api/v3/payment/prepay
*** Test Cases ***
正例-预支付
[Tags] F
create session URI ${URL}
${content} POST请求结果 ${path} {"parentOrderNo":"${order_no}","channel":1} 200 ${zh_token}
log ${content}
Should Be Equal As Strings ${content["code"]} 200
Should Contain ${content["data"]} out_trade_no
Should Contain ${content["data"]} attachment
正例-指定支付宝渠道
[Tags] F
create session URI ${URL}
${content} POST请求结果 ${path} {"parentOrderNo":"${order_no}","channel":2} 200 ${zh_token}
log ${content}
Should Be Equal As Strings ${content["code"]} 200
反例-不传入parentOrderNo
[Tags] E
create session URI ${URL}
${content} POST请求结果 ${path} {"channel":1} 422 ${zh_token}
log ${content}
Should Contain ${content} detail
反例-传入不存在的订单号
[Tags] E
create session URI ${URL}
${content} POST请求结果 ${path} {"parentOrderNo":"invalid_order_no","channel":1} 200 ${zh_token}
log ${content}
Should Not Be Equal As Strings ${content["code"]} 200
反例-传入无效token
[Tags] E
create session URI ${URL}
${content} POST请求结果 ${path} {"parentOrderNo":"${order_no}","channel":1} 401 {}
log ${content}
Should Be Equal As Strings ${content["code"]} 401
*** Settings ***
Resource ../flow_zmx.resource
Resource ../res_zmx.resource
*** Variables ***
${path} /api/v3/payment/order
*** Test Cases ***
正例-取消订单
[Tags] F
create session URI ${URL}
${content} POST请求结果 ${path}/${order_no}S1001/cancel {} 200 ${zh_token}
log ${content}
Should Be Equal As Strings ${content["code"]} 200
Should Be Equal As Strings ${content["data"]} True
反例-取消不存在的订单
[Tags] E
create session URI ${URL}
${content} POST请求结果 ${path}/invalid_order_no/cancel {} 200 ${zh_token}
log ${content}
Should Not Be Equal As Strings ${content["code"]} 200
反例-传入无效token
[Tags] E
create session URI ${URL}
${content} POST请求结果 ${path}/${order_no}S1001/cancel {} 401 {}
log ${content}
Should Be Equal As Strings ${content["code"]} 401
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论