2020-08-27 10:07:46 +03:00
|
|
|
GET http://localhost:8000/captures
|
|
|
|
|
2022-11-11 16:25:00 +03:00
|
|
|
HTTP 200
|
2020-08-27 10:07:46 +03:00
|
|
|
[Captures]
|
|
|
|
param1: header "header1"
|
|
|
|
param2: header "header2" regex "Hello (.*)!"
|
2022-06-23 16:31:48 +03:00
|
|
|
param3: header "header2" regex /Hello (.*)!/
|
2022-12-01 16:24:03 +03:00
|
|
|
# With the next captures, we test that the captured variable
|
|
|
|
# can be immediatlety used in the next captures + asserts
|
|
|
|
data1: body
|
|
|
|
data2: variable "data1"
|
2020-08-27 10:07:46 +03:00
|
|
|
[Asserts]
|
2022-03-28 19:04:35 +03:00
|
|
|
variable "param1" == "value1"
|
|
|
|
variable "param2" == "Bob"
|
2022-06-23 16:31:48 +03:00
|
|
|
variable "param3" == "Bob"
|
2022-12-01 16:24:03 +03:00
|
|
|
variable "data2" == "Hello world!"
|
|
|
|
|
2020-08-27 10:07:46 +03:00
|
|
|
|
|
|
|
GET http://localhost:8000/captures-check
|
|
|
|
[QueryStringParams]
|
|
|
|
param1: {{param1}}
|
|
|
|
param2: {{param2}}
|
2022-11-11 16:25:00 +03:00
|
|
|
HTTP 200
|
2020-08-27 10:07:46 +03:00
|
|
|
|
|
|
|
|
|
|
|
GET http://localhost:8000/captures-json
|
2022-08-10 21:15:48 +03:00
|
|
|
|
2022-11-11 16:25:00 +03:00
|
|
|
HTTP 200
|
2020-08-27 10:07:46 +03:00
|
|
|
[Captures]
|
2023-06-01 10:24:52 +03:00
|
|
|
an_object: jsonpath "$['an_object']"
|
|
|
|
a_list: jsonpath "$['a_list']"
|
|
|
|
a_null: jsonpath "$['a_null']"
|
2020-08-27 10:07:46 +03:00
|
|
|
an_integer: jsonpath "$['an_integer']"
|
2023-06-01 10:24:52 +03:00
|
|
|
a_float: jsonpath "$['a_float']"
|
|
|
|
a_bool: jsonpath "$['a_bool']"
|
|
|
|
a_string: jsonpath "$['a_string']"
|
|
|
|
all: jsonpath "$"
|
2020-08-27 10:07:46 +03:00
|
|
|
[Asserts]
|
|
|
|
variable "a_null" exists
|
|
|
|
variable "undefined" not exists
|
2022-03-28 19:04:35 +03:00
|
|
|
variable "a_null" == {{a_null}}
|
|
|
|
variable "an_integer" == {{an_integer}}
|
|
|
|
variable "a_float" == {{a_float}}
|
|
|
|
variable "a_bool" == {{a_bool}}
|
|
|
|
variable "a_string" == {{a_string}}
|
2022-08-10 21:15:48 +03:00
|
|
|
variable "a_string" == "{{a_string}}"
|
2022-03-28 19:04:35 +03:00
|
|
|
variable "a_list" == {{a_list}}
|
2020-08-27 10:07:46 +03:00
|
|
|
|
|
|
|
|