hurl/integration/tests_ok/variables.hurl
jcamiel 28b5a49c1d
Update variables.hurl integration test.
We can define multiple variables in [Options] section. Contrary to other options, variables defined on this request are still available to following entries.
2023-01-03 17:43:13 +01:00

52 lines
1.1 KiB
Plaintext

# Variables can be set from:
# - an external properties file
# - at the command-line with the --variable option
# - with HURL_xxx environment variable
# - in the Hurl File in the [Options] section
POST http://localhost:8000/variables
Name: {{name}}
Age: {{age}}
Height: {{height}}
Female: {{female}}
Id: {{my-id}}
A_Null: {{a_null}}
Country: {{country}}
Planet: {{planet}}
[Options]
variable: country=Italy
variable: planet=The Earth
{
"name": "{{name}}",
"age": {{age}},
"height": {{height}},
"female": {{female}},
"id": "{{my-id}}",
"a_null": {{a_null}},
"country": "{{country}}",
"planet": "{{planet}}"
}
HTTP 200
[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"
# `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}}`