diff --git a/integration/hurlfmt/tests_export/body.html b/integration/hurlfmt/tests_export/body.html new file mode 100644 index 000000000..75cbbf67f --- /dev/null +++ b/integration/hurlfmt/tests_export/body.html @@ -0,0 +1,25 @@ +
POST http://localhost:8000/json
+{
+   "message": "Hello"
+}
+
+POST http://localhost:8000/xml
+<message>Hello</message>
+
+POST http://localhost:8000/multiline-string
+```
+Hello
+```
+
+POST http://localhost:8000/oneline-string
+```Hello```
+
+POST http://localhost:8000/oneline-base64
+base64,bGluZTEKbGluZTINCmxpbmUzCg==;
+
+POST http://localhost:8000/oneline-file
+file,data.bin;
+
+POST http://localhost:8000/oneline-hex
+hex,010203;
+
diff --git a/integration/hurlfmt/tests_export/body.hurl b/integration/hurlfmt/tests_export/body.hurl new file mode 100644 index 000000000..277f954e8 --- /dev/null +++ b/integration/hurlfmt/tests_export/body.hurl @@ -0,0 +1,24 @@ +POST http://localhost:8000/json +{ + "message": "Hello" +} + +POST http://localhost:8000/xml +Hello + +POST http://localhost:8000/multiline-string +``` +Hello +``` + +POST http://localhost:8000/oneline-string +```Hello``` + +POST http://localhost:8000/oneline-base64 +base64,bGluZTEKbGluZTINCmxpbmUzCg==; + +POST http://localhost:8000/oneline-file +file,data.bin; + +POST http://localhost:8000/oneline-hex +hex,010203; diff --git a/integration/hurlfmt/tests_export/body.json b/integration/hurlfmt/tests_export/body.json new file mode 100644 index 000000000..5884bf2f1 --- /dev/null +++ b/integration/hurlfmt/tests_export/body.json @@ -0,0 +1 @@ +{"entries":[{"request":{"method":"POST","url":"http://localhost:8000/json","body":{"type":"json","value":{"message":"Hello"}}}},{"request":{"method":"POST","url":"http://localhost:8000/xml","body":{"type":"xml","value":"Hello"}}},{"request":{"method":"POST","url":"http://localhost:8000/multiline-string","body":{"type":"text","value":"Hello\n"}}},{"request":{"method":"POST","url":"http://localhost:8000/oneline-string","body":{"type":"text","value":"Hello"}}},{"request":{"method":"POST","url":"http://localhost:8000/oneline-base64","body":{"encoding":"base64","value":"bGluZTEKbGluZTINCmxpbmUzCg=="}}},{"request":{"method":"POST","url":"http://localhost:8000/oneline-file","body":{"type":"file","filename":"data.bin"}}},{"request":{"method":"POST","url":"http://localhost:8000/oneline-hex","body":{"encoding":"base64","value":"AQID"}}}]} diff --git a/integration/hurlfmt/tests_export/options.html b/integration/hurlfmt/tests_export/options.html index 1b351d630..0e1c54daa 100644 --- a/integration/hurlfmt/tests_export/options.html +++ b/integration/hurlfmt/tests_export/options.html @@ -25,6 +25,10 @@ retry: 4 retry-interval: 1000 skip: false +variable: user=null +variable: status=true +variable: count=2 +variable: score=7.7 variable: name=Bob verbose: false very-verbose: false diff --git a/integration/hurlfmt/tests_export/options.hurl b/integration/hurlfmt/tests_export/options.hurl index 19103355e..213a0eb1a 100644 --- a/integration/hurlfmt/tests_export/options.hurl +++ b/integration/hurlfmt/tests_export/options.hurl @@ -25,6 +25,10 @@ retry: -1 retry: 4 retry-interval: 1000 skip: false +variable: user=null +variable: status=true +variable: count=2 +variable: score=7.7 variable: name=Bob verbose: false very-verbose: false diff --git a/integration/hurlfmt/tests_export/options.json b/integration/hurlfmt/tests_export/options.json index 6ab3293f1..09907f543 100644 --- a/integration/hurlfmt/tests_export/options.json +++ b/integration/hurlfmt/tests_export/options.json @@ -1 +1 @@ -{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/hello","options":[{"name":"aws-sigv4","value":"aws:amz:eu-central-1:sts"},{"name":"cacert","value":"cacertfile"},{"name":"cert","value":"certfile"},{"name":"key","value":"keyfile"},{"name":"compressed","value":false},{"name":"connect-to","value":"example.com:443:example.net:8443"},{"name":"delay","value":1000},{"name":"location","value":false},{"name":"http1.0","value":false},{"name":"http1.1","value":false},{"name":"http2","value":false},{"name":"http3","value":false},{"name":"insecure","value":false},{"name":"ipv4","value":false},{"name":"ipv6","value":false},{"name":"max-redirs","value":10},{"name":"output","value":"output.txt"},{"name":"path-as-is","value":false},{"name":"proxy","value":"http://proxy.example"},{"name":"resolve","value":"example.com:443:127.0.0.1"},{"name":"retry","value":0},{"name":"retry","value":-1},{"name":"retry","value":4},{"name":"retry-interval","value":1000},{"name":"skip","value":false},{"name":"variable","value":"name=Bob"},{"name":"verbose","value":false},{"name":"very-verbose","value":false}]}},{"request":{"method":"GET","url":"http://localhost:8000/hello","options":[{"name":"aws-sigv4","value":"{{aws-sigv4}}"},{"name":"compressed","value":"{{compressed}}"},{"name":"connect-to","value":"{{connect-to}}"},{"name":"delay","value":"{{delay}}"},{"name":"location","value":"{{location}}"},{"name":"http1.0","value":"{{http10}}"},{"name":"http1.1","value":"{{http11}}"},{"name":"http2","value":"{{http2}}"},{"name":"http3","value":"{{http3}}"},{"name":"insecure","value":"{{insecure}}"},{"name":"ipv4","value":"{{ipv4}}"},{"name":"ipv6","value":"{{ipv6}}"},{"name":"max-redirs","value":"{{max-redirs}}"},{"name":"path-as-is","value":"{{path-as-is}}"},{"name":"proxy","value":"{{proxy}}"},{"name":"resolve","value":"{{resolve}}"},{"name":"retry","value":"{{retry}}"},{"name":"retry-interval","value":"{{retry-interval}}"},{"name":"skip","value":"{{skip}}"},{"name":"verbose","value":"{{verbose}}"},{"name":"very-verbose","value":"{{very-verbose}}"}]}}]} +{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/hello","options":[{"name":"aws-sigv4","value":"aws:amz:eu-central-1:sts"},{"name":"cacert","value":"cacertfile"},{"name":"cert","value":"certfile"},{"name":"key","value":"keyfile"},{"name":"compressed","value":false},{"name":"connect-to","value":"example.com:443:example.net:8443"},{"name":"delay","value":1000},{"name":"location","value":false},{"name":"http1.0","value":false},{"name":"http1.1","value":false},{"name":"http2","value":false},{"name":"http3","value":false},{"name":"insecure","value":false},{"name":"ipv4","value":false},{"name":"ipv6","value":false},{"name":"max-redirs","value":10},{"name":"output","value":"output.txt"},{"name":"path-as-is","value":false},{"name":"proxy","value":"http://proxy.example"},{"name":"resolve","value":"example.com:443:127.0.0.1"},{"name":"retry","value":0},{"name":"retry","value":-1},{"name":"retry","value":4},{"name":"retry-interval","value":1000},{"name":"skip","value":false},{"name":"variable","value":"user=null"},{"name":"variable","value":"status=true"},{"name":"variable","value":"count=2"},{"name":"variable","value":"score=7.7"},{"name":"variable","value":"name=Bob"},{"name":"verbose","value":false},{"name":"very-verbose","value":false}]}},{"request":{"method":"GET","url":"http://localhost:8000/hello","options":[{"name":"aws-sigv4","value":"{{aws-sigv4}}"},{"name":"compressed","value":"{{compressed}}"},{"name":"connect-to","value":"{{connect-to}}"},{"name":"delay","value":"{{delay}}"},{"name":"location","value":"{{location}}"},{"name":"http1.0","value":"{{http10}}"},{"name":"http1.1","value":"{{http11}}"},{"name":"http2","value":"{{http2}}"},{"name":"http3","value":"{{http3}}"},{"name":"insecure","value":"{{insecure}}"},{"name":"ipv4","value":"{{ipv4}}"},{"name":"ipv6","value":"{{ipv6}}"},{"name":"max-redirs","value":"{{max-redirs}}"},{"name":"path-as-is","value":"{{path-as-is}}"},{"name":"proxy","value":"{{proxy}}"},{"name":"resolve","value":"{{resolve}}"},{"name":"retry","value":"{{retry}}"},{"name":"retry-interval","value":"{{retry-interval}}"},{"name":"skip","value":"{{skip}}"},{"name":"verbose","value":"{{verbose}}"},{"name":"very-verbose","value":"{{very-verbose}}"}]}}]} diff --git a/integration/hurlfmt/tests_export/predicate_value.html b/integration/hurlfmt/tests_export/predicate_value.html new file mode 100644 index 000000000..b450c5fcf --- /dev/null +++ b/integration/hurlfmt/tests_export/predicate_value.html @@ -0,0 +1,19 @@ +
GET http://localhost:8000/predicate-value
+HTTP 200
+[Asserts]
+jsonpath "$.null" == null
+jsonpath "$.boolean" == true
+jsonpath "$.integer" == 2
+jsonpath "$.float" == 2.5
+jsonpath "$.string" == "Hello"
+jsonpath "$.template" == "Hello {{name}}!"
+jsonpath "$.multiline_string" == ```
+Hello
+Bob!
+```
+jsonpath "$.hex" == hex,010203;
+jsonpath "$.base64" == base64,bGluZTEKbGluZTINCmxpbmUzCg==;
+jsonpath "$.file" == file,data.bin;
+jsonpath "$.expression" == {{expression}}
+
+
diff --git a/integration/hurlfmt/tests_export/predicate_value.hurl b/integration/hurlfmt/tests_export/predicate_value.hurl new file mode 100644 index 000000000..83ee4347e --- /dev/null +++ b/integration/hurlfmt/tests_export/predicate_value.hurl @@ -0,0 +1,18 @@ +GET http://localhost:8000/predicate-value +HTTP 200 +[Asserts] +jsonpath "$.null" == null +jsonpath "$.boolean" == true +jsonpath "$.integer" == 2 +jsonpath "$.float" == 2.5 +jsonpath "$.string" == "Hello" +jsonpath "$.template" == "Hello {{name}}!" +jsonpath "$.multiline_string" == ``` +Hello +Bob! +``` +jsonpath "$.hex" == hex,010203; +jsonpath "$.base64" == base64,bGluZTEKbGluZTINCmxpbmUzCg==; +jsonpath "$.file" == file,data.bin; +jsonpath "$.expression" == {{expression}} + diff --git a/integration/hurlfmt/tests_export/predicate_value.json b/integration/hurlfmt/tests_export/predicate_value.json new file mode 100644 index 000000000..472ce8cf2 --- /dev/null +++ b/integration/hurlfmt/tests_export/predicate_value.json @@ -0,0 +1 @@ +{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/predicate-value"},"response":{"status":200,"asserts":[{"query":{"type":"jsonpath","expr":"$.null"},"predicate":{"type":"equal","value":null}},{"query":{"type":"jsonpath","expr":"$.boolean"},"predicate":{"type":"equal","value":true}},{"query":{"type":"jsonpath","expr":"$.integer"},"predicate":{"type":"equal","value":2}},{"query":{"type":"jsonpath","expr":"$.float"},"predicate":{"type":"equal","value":2.5}},{"query":{"type":"jsonpath","expr":"$.string"},"predicate":{"type":"equal","value":"Hello"}},{"query":{"type":"jsonpath","expr":"$.template"},"predicate":{"type":"equal","value":"Hello {{name}}!"}},{"query":{"type":"jsonpath","expr":"$.multiline_string"},"predicate":{"type":"equal","value":"Hello\nBob!\n"}},{"query":{"type":"jsonpath","expr":"$.hex"},"predicate":{"type":"equal","value":"AQID","encoding":"base64"}},{"query":{"type":"jsonpath","expr":"$.base64"},"predicate":{"type":"equal","value":"bGluZTEKbGluZTINCmxpbmUzCg==","encoding":"base64"}},{"query":{"type":"jsonpath","expr":"$.file"},"predicate":{"type":"equal","value":{"type":"file","filename":"data.bin"}}},{"query":{"type":"jsonpath","expr":"$.expression"},"predicate":{"type":"equal","value":"expression"}}]}}]}