mirror of
https://github.com/Orange-OpenSource/hurl.git
synced 2024-12-18 16:11:34 +03:00
2 lines
5.9 KiB
JSON
2 lines
5.9 KiB
JSON
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/assert-json"},"response":{"status":200,"captures":[{"name":"count","query":{"type":"jsonpath","expr":"$.count"}}],"asserts":[{"query":{"type":"jsonpath","expr":"$.count"},"predicate":{"type":"equal","value":5}},{"query":{"type":"jsonpath","expr":"$.count"},"predicate":{"type":"equal","value":5.0}},{"query":{"type":"jsonpath","expr":"$.count"},"predicate":{"type":"equal","value":"five"}},{"query":{"type":"jsonpath","expr":"$.count"},"predicate":{"type":"not-equal","value":4}},{"query":{"type":"jsonpath","expr":"$.count"},"predicate":{"type":"not-equal","value":"four"}},{"query":{"type":"jsonpath","expr":"$.count"},"predicate":{"not":true,"type":"equal","value":4}},{"query":{"type":"jsonpath","expr":"$.count"},"predicate":{"type":"greater","value":1}},{"query":{"type":"jsonpath","expr":"$.count"},"predicate":{"type":"greater","value":"one"}},{"query":{"type":"jsonpath","expr":"$.count"},"predicate":{"type":"greater","value":1.0}},{"query":{"type":"jsonpath","expr":"$.success"},"predicate":{"type":"equal","value":false}},{"query":{"type":"jsonpath","expr":"$.success"},"predicate":{"type":"not-equal","value":null}},{"query":{"type":"jsonpath","expr":"$.success"},"predicate":{"type":"exist"}},{"query":{"type":"jsonpath","expr":"$.success"},"predicate":{"type":"isBoolean"}},{"query":{"type":"jsonpath","expr":"$.errors"},"filters":[{"type":"count"}],"predicate":{"type":"equal","value":2}},{"query":{"type":"jsonpath","expr":"$.errors"},"predicate":{"type":"isCollection"}},{"query":{"type":"jsonpath","expr":"$.failures"},"filters":[{"type":"count"}],"predicate":{"type":"equal","value":1}},{"query":{"type":"jsonpath","expr":"$.failures"},"predicate":{"type":"isCollection"}},{"query":{"type":"jsonpath","expr":"$.warnings"},"filters":[{"type":"count"}],"predicate":{"type":"equal","value":0}},{"query":{"type":"jsonpath","expr":"$.warnings"},"predicate":{"type":"isEmpty"}},{"query":{"type":"jsonpath","expr":"$.toto"},"predicate":{"not":true,"type":"exist"}},{"query":{"type":"jsonpath","expr":"$.failures"},"predicate":{"type":"exist"}},{"query":{"type":"jsonpath","expr":"$.warnings"},"predicate":{"type":"exist"}},{"query":{"type":"jsonpath","expr":"$.errors[0]"},"predicate":{"type":"exist"}},{"query":{"type":"jsonpath","expr":"$.errors[0]"},"predicate":{"type":"isCollection"}},{"query":{"type":"jsonpath","expr":"$.errors[0].id"},"predicate":{"type":"equal","value":"error1"}},{"query":{"type":"jsonpath","expr":"$.errors[0]['id']"},"predicate":{"type":"equal","value":"error1"}},{"query":{"type":"jsonpath","expr":"$.errors[*].id"},"predicate":{"type":"include","value":"error1"}},{"query":{"type":"jsonpath","expr":"$.errors[?(@.id=='error1')].id"},"filters":[{"type":"nth","n":0}],"predicate":{"type":"equal","value":"error1"}},{"query":{"type":"jsonpath","expr":"$.failures[*].id"},"predicate":{"type":"include","value":"failure1"}},{"query":{"type":"jsonpath","expr":"$.duration"},"predicate":{"type":"equal","value":1.5}},{"query":{"type":"jsonpath","expr":"$.duration"},"predicate":{"type":"less-or-equal","value":2.0}},{"query":{"type":"jsonpath","expr":"$.duration"},"predicate":{"type":"less","value":2}},{"query":{"type":"jsonpath","expr":"$.duration"},"predicate":{"type":"less","value":"two"}},{"query":{"type":"jsonpath","expr":"$.duration"},"predicate":{"type":"isFloat"}},{"query":{"type":"jsonpath","expr":"$.duration"},"predicate":{"not":true,"type":"isInteger"}},{"query":{"type":"jsonpath","expr":"$.nullable"},"predicate":{"type":"equal","value":null}},{"query":{"type":"jsonpath","expr":"$.tags[0]"},"predicate":{"type":"equal","value":"test"}},{"query":{"type":"jsonpath","expr":"$.tags[0]"},"predicate":{"type":"greater","value":"te"}},{"query":{"type":"jsonpath","expr":"$.tags[0]"},"predicate":{"type":"less","value":"testabc"}},{"query":{"type":"jsonpath","expr":"$.tags[0]"},"predicate":{"type":"less-or-equal","value":"test"}},{"query":{"type":"jsonpath","expr":"$.tags[0]"},"predicate":{"type":"greater","value":"{{foo}}"}},{"query":{"type":"jsonpath","expr":"$.profile-id"},"predicate":{"type":"equal","value":"123abc"}},{"query":{"type":"jsonpath","expr":"$['profile-id']"},"predicate":{"type":"equal","value":"123abc"}}],"body":{"type":"json","value":{"count":5,"success":false,"errors":[{"id":"error1"},{"id":"error2"}],"failures":[{"id":"failure1"}],"warnings":[],"duration":1.5,"tags":["test"],"nullable":null,"profile-id":"123abc"}}}},{"request":{"method":"GET","url":"http://localhost:8000/assert-json/index"},"response":{"status":200,"captures":[{"name":"index","query":{"type":"body"}}]}},{"request":{"method":"GET","url":"http://localhost:8000/assert-json"},"response":{"status":200,"asserts":[{"query":{"type":"jsonpath","expr":"$.errors[{{index}}].id"},"predicate":{"type":"equal","value":"error2"}},{"query":{"type":"jsonpath","expr":"$.tags"},"predicate":{"type":"include","value":"test"}},{"query":{"type":"jsonpath","expr":"$.tags"},"predicate":{"not":true,"type":"include","value":"prod"}},{"query":{"type":"jsonpath","expr":"$.tags"},"predicate":{"not":true,"type":"include","value":null}}]}},{"request":{"method":"GET","url":"http://localhost:8000/assert-json/list"},"response":{"status":200,"asserts":[{"query":{"type":"jsonpath","expr":"$"},"filters":[{"type":"count"}],"predicate":{"type":"equal","value":2}},{"query":{"type":"jsonpath","expr":"$.[0].name"},"predicate":{"type":"equal","value":"Bob"}},{"query":{"type":"jsonpath","expr":"$[0].name"},"predicate":{"type":"equal","value":"Bob"}},{"query":{"type":"jsonpath","expr":"$.[?(@.id == 1)].name"},"filters":[{"type":"nth","n":0}],"predicate":{"type":"equal","value":"Bob"}},{"query":{"type":"jsonpath","expr":"$[?(@.id == 1)].name"},"filters":[{"type":"nth","n":0}],"predicate":{"type":"equal","value":"Bob"}}]}},{"request":{"method":"GET","url":"http://localhost:8000/assert-json/filter"},"response":{"status":200,"asserts":[{"query":{"type":"jsonpath","expr":"$.fruit[?(@.price.US==200)].name"},"filters":[{"type":"nth","n":0}],"predicate":{"type":"equal","value":"grape"}}]}}]}
|