hurl/integration/tests_ok/variables.hurl

55 lines
1.2 KiB
Plaintext
Raw Normal View History

2022-09-02 11:50:43 +03:00
# Variables can be set from:
# - an external properties file
# - at the command-line with the --variable option
2022-09-07 20:12:25 +03:00
# - with HURL_xxx environment variable
2022-09-02 11:50:43 +03:00
# - in the Hurl File in the [Options] section
2021-01-09 12:25:01 +03:00
POST http://localhost:8000/variables
2021-09-10 18:35:23 +03:00
Name: {{name}}
Age: {{age}}
Height: {{height}}
Female: {{female}}
Id: {{my-id}}
2023-05-02 09:43:38 +03:00
A-Null: {{a_null}}
2022-09-02 11:50:43 +03:00
Country: {{country}}
Planet: {{planet}}
Galaxy: {{galaxy}}
2022-09-02 11:50:43 +03:00
[Options]
variable: country=Italy
variable: planet=The Earth
2021-01-09 12:25:01 +03:00
{
"name": "{{name}}",
"age": {{age}},
2021-02-25 22:33:14 +03:00
"height": {{height}},
"female": {{female}},
2021-09-10 18:35:23 +03:00
"id": "{{my-id}}",
2022-09-02 11:50:43 +03:00
"a_null": {{a_null}},
"country": "{{country}}",
"planet": "{{planet}}",
"galaxy": "{{galaxy}}"
2021-01-09 12:25:01 +03:00
}
2021-02-25 22:33:14 +03:00
2022-11-11 16:25:00 +03:00
HTTP 200
2021-02-25 22:33:14 +03:00
[Asserts]
variable "name" == "Jennifer"
variable "female" == true
variable "age" == 30
variable "height" == 1.70
variable "a_null" == null
variable "my-id" == "123"
variable "country" == "Italy"
variable "planet" == "The Earth"
variable "galaxy" == "Milky Way"
# `country` and `planet` variable are still available
# for the next entries, even if they've been defined in the
# previous `[Options]` request section.
GET http://localhost:8000/variable/country
HTTP 200
`{{country}}`
GET http://localhost:8000/variable/planet
HTTP 200
`{{planet}}`