@apistudio/apim-cli
Version:
CLI for API Management Products
46 lines (45 loc) • 1.09 kB
YAML
info:
testName: 'ATM IF Tests'
version: 2
configs:
globalVariables:
base_url: url.com
api_key: "abcd"
value: 2
inputs:
- default:
X-IBM-Client-Id: X-IBM-Client-Id
orderNumber: "3"
steps:
- type: request
method: get
url: "{{ base_url }}/bank/{{value}}"
headers:
Authorization: "Bearer {{ api_key }}"
var: branches
mode: json
- type: if
expression: branches
steps:
- type: assert-exists
expression: branches.[1]
stoponfail: "{{ boolean }}"
- type: assert-equals
expression: branches.[0].type
value: string
stoponfail: true
- type: assert-compares
expression1: branches.[0].type
expression2: branches.[1].type
value: string
stoponfail: true
- type: request
method: get
url: https://sample-api.us-east-a.apiconnect.automation.ibm.com/orders/order/AB1234
var: "payload"
mode: json
- type: assert-greater
expression: payload_response_statusCode
value: "{{ value }}"
ifexists: false
stoponfail: false