@@ -21915,6 +21915,125 @@ paths:
21915
21915
requestBody:
21916
21916
content:
21917
21917
application/json:
21918
+ examples:
21919
+ multistep-api-test:
21920
+ description: 'Example of a multistep API test running on a fake furniture
21921
+ store.
21922
+
21923
+ It creates a card, select a product and then add the product to
21924
+ the card.'
21925
+ summary: Create a Multistep API test
21926
+ value:
21927
+ config:
21928
+ steps:
21929
+ - assertions:
21930
+ - operator: lessThan
21931
+ target: 30000
21932
+ type: responseTime
21933
+ extractedValues:
21934
+ - field: location
21935
+ name: CART_ID
21936
+ parser:
21937
+ type: regex
21938
+ value: (?:[^\\/](?!(\\|/)))+$
21939
+ type: http_header
21940
+ name: Get a cart
21941
+ request:
21942
+ method: POST
21943
+ timeout: 30
21944
+ url: https://api.shopist.io/carts
21945
+ subtype: http
21946
+ - assertions:
21947
+ - operator: is
21948
+ target: 200
21949
+ type: statusCode
21950
+ extractedValues:
21951
+ - name: PRODUCT_ID
21952
+ parser:
21953
+ type: json_path
21954
+ value: $[0].id['$oid']
21955
+ type: http_body
21956
+ name: Get a product
21957
+ request:
21958
+ method: GET
21959
+ timeout: 30
21960
+ url: https://api.shopist.io/products.json
21961
+ subtype: http
21962
+ - assertions:
21963
+ - operator: is
21964
+ target: 201
21965
+ type: statusCode
21966
+ name: Add product to cart
21967
+ request:
21968
+ body: "{\n \"cart_item\": {\n \"product_id\": \"{{ PRODUCT_ID
21969
+ }}\",\n \"amount_paid\": 500,\n \"quantity\": 1\n
21970
+ \ },\n \"cart_id\": \"{{ CART_ID }}\"\n}"
21971
+ headers:
21972
+ content-type: application/json
21973
+ method: POST
21974
+ timeout: 30
21975
+ url: https://api.shopist.io/add_item.json
21976
+ subtype: http
21977
+ locations:
21978
+ - aws:us-west-2
21979
+ message: <NOTIFICATION MESSAGE>
21980
+ name: Multistep API test
21981
+ options:
21982
+ ci:
21983
+ executionRule: blocking
21984
+ min_failure_duration: 5400
21985
+ min_location_failed: 1
21986
+ monitor_options:
21987
+ renotify_interval: 0
21988
+ retry:
21989
+ count: 3
21990
+ interval: 300
21991
+ tick_every: 900
21992
+ status: live
21993
+ subtype: multi
21994
+ tags:
21995
+ - env:prod
21996
+ type: api
21997
+ simple-api-test:
21998
+ description: Example of an API test.
21999
+ summary: Create an API test.
22000
+ value:
22001
+ config:
22002
+ assertions:
22003
+ - operator: lessThan
22004
+ target: 1000
22005
+ type: responseTime
22006
+ - operator: is
22007
+ target: 200
22008
+ type: statusCode
22009
+ - operator: is
22010
+ property: content-type
22011
+ target: text/html; charset=UTF-8
22012
+ type: header
22013
+ request:
22014
+ method: GET
22015
+ url: https://example.com
22016
+ locations:
22017
+ - azure:eastus
22018
+ - aws:eu-west-3
22019
+ message: <NOTIFICATION MESSAGE>
22020
+ name: <TEST NAME>
22021
+ options:
22022
+ min_failure_duration: 0
22023
+ min_location_failed: 1
22024
+ monitor_options:
22025
+ include_tags: true
22026
+ locked: false
22027
+ new_host_delay: 300
22028
+ notify_audit: false
22029
+ notify_no_data: false
22030
+ renotify_interval: 0
22031
+ tick_every: 60
22032
+ status: live
22033
+ subtype: http
22034
+ tags:
22035
+ - env:production
22036
+ type: api
21918
22037
schema:
21919
22038
$ref: '#/components/schemas/SyntheticsAPITest'
21920
22039
description: Details of the test to create.
0 commit comments