Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 25 additions & 25 deletions integration/hurl/tests_failed/predicate/predicate.err
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ error: Assert failure
|
| GET http://localhost:8000/predicate/error/type
| ...
32 | jsonpath "$.not-exist" == 2
32 | jsonpath "$.not_exist" == 2
| actual: none
| expected: integer <2>
|
Expand All @@ -300,7 +300,7 @@ error: Assert failure
|
| GET http://localhost:8000/predicate/error/type
| ...
33 | jsonpath "$.not-exist" > 3
33 | jsonpath "$.not_exist" > 3
| actual: none
| expected: greater than <integer <3>>
|
Expand All @@ -310,7 +310,7 @@ error: Assert failure
|
| GET http://localhost:8000/predicate/error/type
| ...
34 | jsonpath "$.not-exist" >= 3
34 | jsonpath "$.not_exist" >= 3
| actual: none
| expected: greater than or equals to <integer <3>>
|
Expand All @@ -320,7 +320,7 @@ error: Assert failure
|
| GET http://localhost:8000/predicate/error/type
| ...
35 | jsonpath "$.not-exist" < 1
35 | jsonpath "$.not_exist" < 1
| actual: none
| expected: less than <integer <1>>
|
Expand All @@ -330,7 +330,7 @@ error: Assert failure
|
| GET http://localhost:8000/predicate/error/type
| ...
36 | jsonpath "$.not-exist" <= 1
36 | jsonpath "$.not_exist" <= 1
| actual: none
| expected: less than or equals to <integer <1>>
|
Expand All @@ -340,7 +340,7 @@ error: Filter error
|
| GET http://localhost:8000/predicate/error/type
| ...
37 | jsonpath "$.not-exist" count == 1
37 | jsonpath "$.not_exist" count == 1
| ^^^^^ missing value to apply filter
|

Expand All @@ -349,7 +349,7 @@ error: Assert failure
|
| GET http://localhost:8000/predicate/error/type
| ...
38 | jsonpath "$.not-exist" startsWith "foo"
38 | jsonpath "$.not_exist" startsWith "foo"
| actual: none
| expected: starts with string <foo>
|
Expand All @@ -359,7 +359,7 @@ error: Assert failure
|
| GET http://localhost:8000/predicate/error/type
| ...
39 | jsonpath "$.not-exist" startsWith hex,efbbbf;
39 | jsonpath "$.not_exist" startsWith hex,efbbbf;
| actual: none
| expected: starts with 3 bytes
|
Expand All @@ -369,7 +369,7 @@ error: Assert failure
|
| GET http://localhost:8000/predicate/error/type
| ...
40 | jsonpath "$.not-exist" endsWith "foo"
40 | jsonpath "$.not_exist" endsWith "foo"
| actual: none
| expected: ends with string <foo>
|
Expand All @@ -379,7 +379,7 @@ error: Assert failure
|
| GET http://localhost:8000/predicate/error/type
| ...
41 | jsonpath "$.not-exist" endsWith hex,00;
41 | jsonpath "$.not_exist" endsWith hex,00;
| actual: none
| expected: ends with 1 byte
|
Expand All @@ -389,7 +389,7 @@ error: Assert failure
|
| GET http://localhost:8000/predicate/error/type
| ...
42 | jsonpath "$.not-exist" contains 1
42 | jsonpath "$.not_exist" contains 1
| actual: none
| expected: contains integer <1>
|
Expand All @@ -399,7 +399,7 @@ error: Assert failure
|
| GET http://localhost:8000/predicate/error/type
| ...
43 | jsonpath "$.not-exist" matches /foo/
43 | jsonpath "$.not_exist" matches /foo/
| actual: none
| expected: matches regex <foo>
|
Expand All @@ -409,7 +409,7 @@ error: Assert failure
|
| GET http://localhost:8000/predicate/error/type
| ...
44 | jsonpath "$.not-exist" isInteger
44 | jsonpath "$.not_exist" isInteger
| actual: none
| expected: integer
|
Expand All @@ -419,7 +419,7 @@ error: Assert failure
|
| GET http://localhost:8000/predicate/error/type
| ...
45 | jsonpath "$.not-exist" isFloat
45 | jsonpath "$.not_exist" isFloat
| actual: none
| expected: float
|
Expand All @@ -429,7 +429,7 @@ error: Assert failure
|
| GET http://localhost:8000/predicate/error/type
| ...
46 | jsonpath "$.not-exist" isBoolean
46 | jsonpath "$.not_exist" isBoolean
| actual: none
| expected: boolean
|
Expand All @@ -439,7 +439,7 @@ error: Assert failure
|
| GET http://localhost:8000/predicate/error/type
| ...
47 | jsonpath "$.not-exist" isString
47 | jsonpath "$.not_exist" isString
| actual: none
| expected: string
|
Expand All @@ -449,7 +449,7 @@ error: Assert failure
|
| GET http://localhost:8000/predicate/error/type
| ...
48 | jsonpath "$.not-exist" isCollection
48 | jsonpath "$.not_exist" isCollection
| actual: none
| expected: collection
|
Expand All @@ -459,7 +459,7 @@ error: Assert failure
|
| GET http://localhost:8000/predicate/error/type
| ...
49 | jsonpath "$.not-exist" isList
49 | jsonpath "$.not_exist" isList
| actual: none
| expected: list
|
Expand All @@ -469,7 +469,7 @@ error: Assert failure
|
| GET http://localhost:8000/predicate/error/type
| ...
50 | jsonpath "$.not-exist" isObject
50 | jsonpath "$.not_exist" isObject
| actual: none
| expected: object
|
Expand All @@ -479,7 +479,7 @@ error: Assert failure
|
| GET http://localhost:8000/predicate/error/type
| ...
51 | jsonpath "$.not-exist" isDate
51 | jsonpath "$.not_exist" isDate
| actual: none
| expected: date
|
Expand All @@ -489,7 +489,7 @@ error: Assert failure
|
| GET http://localhost:8000/predicate/error/type
| ...
52 | jsonpath "$.not-exist" exists
52 | jsonpath "$.not_exist" exists
| actual: none
| expected: something
|
Expand All @@ -499,7 +499,7 @@ error: Assert failure
|
| GET http://localhost:8000/predicate/error/type
| ...
53 | jsonpath "$.not-exist" isEmpty
53 | jsonpath "$.not_exist" isEmpty
| actual: none
| expected: empty
|
Expand All @@ -509,7 +509,7 @@ error: Assert failure
|
| GET http://localhost:8000/predicate/error/type
| ...
54 | jsonpath "$.not-exist" isIpv4
54 | jsonpath "$.not_exist" isIpv4
| actual: none
| expected: ipv4
|
Expand All @@ -519,7 +519,7 @@ error: Assert failure
|
| GET http://localhost:8000/predicate/error/type
| ...
55 | jsonpath "$.not-exist" isIpv6
55 | jsonpath "$.not_exist" isIpv6
| actual: none
| expected: ipv6
|
Expand All @@ -529,7 +529,7 @@ error: Assert failure
|
| GET http://localhost:8000/predicate/error/type
| ...
56 | jsonpath "$.not-exist" isUuid
56 | jsonpath "$.not_exist" isUuid
| actual: none
| expected: uuid
|
Expand Down
50 changes: 25 additions & 25 deletions integration/hurl/tests_failed/predicate/predicate.hurl
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,31 @@ jsonpath "$.message" isUuid
jsonpath "$.toto" exists
jsonpath "$.message" not exists
jsonpath "$.list" count == 2
jsonpath "$.not-exist" == 2
jsonpath "$.not-exist" > 3
jsonpath "$.not-exist" >= 3
jsonpath "$.not-exist" < 1
jsonpath "$.not-exist" <= 1
jsonpath "$.not-exist" count == 1
jsonpath "$.not-exist" startsWith "foo"
jsonpath "$.not-exist" startsWith hex,efbbbf;
jsonpath "$.not-exist" endsWith "foo"
jsonpath "$.not-exist" endsWith hex,00;
jsonpath "$.not-exist" contains 1
jsonpath "$.not-exist" matches /foo/
jsonpath "$.not-exist" isInteger
jsonpath "$.not-exist" isFloat
jsonpath "$.not-exist" isBoolean
jsonpath "$.not-exist" isString
jsonpath "$.not-exist" isCollection
jsonpath "$.not-exist" isList
jsonpath "$.not-exist" isObject
jsonpath "$.not-exist" isDate
jsonpath "$.not-exist" exists
jsonpath "$.not-exist" isEmpty
jsonpath "$.not-exist" isIpv4
jsonpath "$.not-exist" isIpv6
jsonpath "$.not-exist" isUuid
jsonpath "$.not_exist" == 2
jsonpath "$.not_exist" > 3
jsonpath "$.not_exist" >= 3
jsonpath "$.not_exist" < 1
jsonpath "$.not_exist" <= 1
jsonpath "$.not_exist" count == 1
jsonpath "$.not_exist" startsWith "foo"
jsonpath "$.not_exist" startsWith hex,efbbbf;
jsonpath "$.not_exist" endsWith "foo"
jsonpath "$.not_exist" endsWith hex,00;
jsonpath "$.not_exist" contains 1
jsonpath "$.not_exist" matches /foo/
jsonpath "$.not_exist" isInteger
jsonpath "$.not_exist" isFloat
jsonpath "$.not_exist" isBoolean
jsonpath "$.not_exist" isString
jsonpath "$.not_exist" isCollection
jsonpath "$.not_exist" isList
jsonpath "$.not_exist" isObject
jsonpath "$.not_exist" isDate
jsonpath "$.not_exist" exists
jsonpath "$.not_exist" isEmpty
jsonpath "$.not_exist" isIpv4
jsonpath "$.not_exist" isIpv6
jsonpath "$.not_exist" isUuid
jsonpath "$.not_a_date" isIsoDate
jsonpath "$.is_a_date" not isIsoDate
jsonpath "$.not_a_date" isNumber
Expand Down
33 changes: 17 additions & 16 deletions integration/hurl/tests_ok/assert/assert_json.hurl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jsonpath "$.errors[0,1].id" contains "error1"
jsonpath "$.errors[:2].id" count == 2
jsonpath "$.errors[0:].id" count == 2
jsonpath "$.errors[?(@.id)].id" nth 0 == "error1"
jsonpath "$.errors[?(@.id=='error1')].id" nth 0 == "error1"
jsonpath "$.errors[?(@.id=='error1')].id" == "error1"
jsonpath "$.failures[*].id" contains "failure1"
jsonpath "$.duration" == 1.5
jsonpath "$.duration" <= 2.0
Expand All @@ -68,7 +68,7 @@ jsonpath "$.tags[0]" > "te"
jsonpath "$.tags[0]" < "testabc"
jsonpath "$.tags[0]" <= "test"
jsonpath "$.tags[0]" > "{{foo}}"
jsonpath "$.profile-id" == "123abc"
#jsonpath "$.profile-id" == "123abc" # hyphen not valid in shorthand notation
jsonpath "$['profile-id']" == "123abc"
jsonpath "$.errors[0]" not isEmpty
jsonpath "$.empty" isEmpty
Expand Down Expand Up @@ -130,17 +130,18 @@ GET http://localhost:8000/assert-json/list
HTTP 200
[Asserts]
jsonpath "$" count == 2
jsonpath "$.[0].name" == "Bob"
jsonpath "$[0].name" == "Bob"
jsonpath "$.[?(@.id == 1)].name" nth 0 == "Bob"
jsonpath "$[?(@.id == 1)].name" nth 0 == "Bob"

jsonpath "$[?(@.id == 1)].name" == "Bob"
[
{ "id": 1, "name": "Bob"},
{ "id": 2, "name": "Bill"}
]

GET http://localhost:8000/assert-json/filter
HTTP 200
[Asserts]
jsonpath "$.fruit[?(@.price.US==200)].name" nth 0 == "grape"
jsonpath "$.fruit.[?(@.US == 100)]" count == 0 # To be clarified with spec: the first fruit is return by jsonpath.com
jsonpath "$.fruit[?(@.price.US==200)].name" == "grape"
jsonpath "$.fruit[?(@.US == 100)]" not exists
{
"fruit": [
{
Expand All @@ -166,20 +167,20 @@ HTTP 200
[Asserts]

jsonpath "$..*[?(@.name)]" count == 5
jsonpath "$..*[?(@.name=='car')].id" nth 0 == 1
jsonpath "$..*[?(@.name=='wheel')].id" nth 0 == 4
jsonpath "$..*[?(@.name=='car')].id" == 1
jsonpath "$..*[?(@.name=='wheel')].id" == 4

jsonpath "$..items[?(@.name)]" count == 5
jsonpath "$..items[?(@.name=='car')].id" nth 0 == 1
jsonpath "$..items[?(@.name=='wheel')].id" nth 0 == 4
jsonpath "$..items[?(@.name=='car')].id" == 1
jsonpath "$..items[?(@.name=='wheel')].id" == 4

jsonpath "$.main.items[?(@.name)]" count == 3
jsonpath "$.main.items[?(@.name=='car')].id" nth 0 == 1
jsonpath "$.main.items[?(@.name=='wheel')].id" isEmpty
jsonpath "$.main.items[?(@.name=='car')].id" == 1
jsonpath "$.main.items[?(@.name=='wheel')].id" not exists

jsonpath "$.main..items[?(@.name)]" count == 4
jsonpath "$.main..items[?(@.name=='car')].id" nth 0 == 1
jsonpath "$.main..items[?(@.name=='wheel')].id" nth 0 == 4
jsonpath "$.main..items[?(@.name=='car')].id" == 1
jsonpath "$.main..items[?(@.name=='wheel')].id" == 4

{
"main": {
Expand Down
16 changes: 9 additions & 7 deletions integration/hurl/tests_ok/jsonpath/jsonpath_store.hurl
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ jsonpath "$..author" nth 2 == "Herman Melville"
jsonpath "$..author" nth 3 == "J. R. R. Tolkien"
jsonpath "$.store.*" count == 2 # all things in store, which are some books and a red bicycle.
jsonpath "$.store..price" count == 5 # the price of everything in the store.
jsonpath "$..book[2].title" nth 0 == "Moby Dick" # the third book
jsonpath "$..book[-1].title" nth 0 == "The Lord of the Rings" # the last book
jsonpath "$.store.book[2].title" == "Moby Dick" # the third book
jsonpath "$.store.book[-1].title" == "The Lord of the Rings" # the last book
jsonpath "$..book[2].title" == "Moby Dick" # the third book
jsonpath "$..book[-1].title" == "The Lord of the Rings" # the last book
#jsonpath "$..book[(@.length-1)].title" nth 0 == "The Lord of the Rings" # not supported yet
#jsonpath "$..book[*]" last jsonpath "$.title" == "The Lord of the Rings" # alternative
jsonpath "$..book[-1:].title" nth 0 == "The Lord of the Rings" # the last book in order.
#jsonpath "$..book[*]" last jsonpath "$.title" == "The Lord of the Rings" # alternative
jsonpath "$..book[-1:].title" == "The Lord of the Rings" # the last book in order.
jsonpath "$..book[0,1]" count == 2 # the first two books
jsonpath "$..book[0,1].title" nth 0 == "Sayings of the Century"
jsonpath "$..book[0,1].title" nth 1 == "Sword of Honour"
Expand All @@ -30,18 +32,18 @@ jsonpath "$..book[:2].title" nth 1 == "Sword of Honour"
jsonpath "$..book[?(@.isbn)]" count == 2 # filter all books with isbn number
jsonpath "$..book[?(@.isbn)].title" nth 0 == "Moby Dick"
jsonpath "$..book[?(@.isbn)].title" nth 1 == "The Lord of the Rings"
jsonpath "$..book[?(@.isbn)].not_exist" count == 0 # querying field that does not exist return an empty list
jsonpath "$..book[?(@.isbn)].not_exist" not exists # querying field that does not exist return nothing
jsonpath "$..book[?(@.price<10)]" count == 2 # filter all books cheaper than 10
jsonpath "$..book[?(@.price<10)].title" nth 0 == "Sayings of the Century"
jsonpath "$..book[?(@.price<10)].title" nth 1 == "Moby Dick"
jsonpath "$.store.book[?(@.published==true)].title" nth 0 == "Moby Dick" # filter on published books
jsonpath "$.store.book[?(@.published==true)].title" == "Moby Dick" # filter on published books
jsonpath "$..book[?(@.author != 'Charles Dickens')]" count == 4 # filter all books for author other than Charles Dickens
jsonpath "$..book[?(@.author != 'Nigel Rees')]" count == 3 # filter all books for author other than Nogen Rees
jsonpath "$..book[?(@.price != 10.00)]" count == 4 # filter all books for price different from 10.00
jsonpath "$..book[?(@.price != 8.95)]" count == 3 # filter all books for price different from 8.95
jsonpath "$..*" count == 31 # all members of JSON structure.
jsonpath "$..book[*].isbn" count == 2 # get list of isbn numbers
jsonpath "$..book[*].not_exist" count == 0 # querying field that does not exist return an empty list
jsonpath "$..book[*].not_exist" not exists # querying field that does not exist return an empty list
jsonpath "$..book[4]" not exists # out of bound
jsonpath "$..book[-5]" not exists # out of bound
jsonpath "$.store[0]" not exists # array indexing for an object
Expand Down
Loading
Loading