mirror of
https://github.com/Orange-OpenSource/hurl.git
synced 2024-11-27 16:26:40 +03:00
Add integ tests export
This commit is contained in:
parent
d42fb9bc95
commit
4ff045654d
25
integration/hurlfmt/tests_export/body.html
Normal file
25
integration/hurlfmt/tests_export/body.html
Normal file
@ -0,0 +1,25 @@
|
||||
<pre><code class="language-hurl"><span class="hurl-entry"><span class="request"><span class="line"><span class="method">POST</span> <span class="url">http://localhost:8000/json</span></span>
|
||||
<span class="json"><span class="line">{</span>
|
||||
<span class="line"> "message": "Hello"</span>
|
||||
<span class="line">}</span></span>
|
||||
</span></span><span class="hurl-entry"><span class="request"><span class="line"></span>
|
||||
<span class="line"><span class="method">POST</span> <span class="url">http://localhost:8000/xml</span></span>
|
||||
<span class="xml"><span class="line"><message>Hello</message></span></span>
|
||||
</span></span><span class="hurl-entry"><span class="request"><span class="line"></span>
|
||||
<span class="line"><span class="method">POST</span> <span class="url">http://localhost:8000/multiline-string</span></span>
|
||||
<span class="multiline"><span class="line">```</span>
|
||||
<span class="line">Hello</span>
|
||||
<span class="line">```</span></span>
|
||||
</span></span><span class="hurl-entry"><span class="request"><span class="line"></span>
|
||||
<span class="line"><span class="method">POST</span> <span class="url">http://localhost:8000/oneline-string</span></span>
|
||||
<span class="multiline"><span class="line">```Hello```</span></span>
|
||||
</span></span><span class="hurl-entry"><span class="request"><span class="line"></span>
|
||||
<span class="line"><span class="method">POST</span> <span class="url">http://localhost:8000/oneline-base64</span></span>
|
||||
<span class="line">base64,<span class="base64">bGluZTEKbGluZTINCmxpbmUzCg==</span>;</span>
|
||||
</span></span><span class="hurl-entry"><span class="request"><span class="line"></span>
|
||||
<span class="line"><span class="method">POST</span> <span class="url">http://localhost:8000/oneline-file</span></span>
|
||||
<span class="line">file,<span class="filename">data.bin</span>;</span>
|
||||
</span></span><span class="hurl-entry"><span class="request"><span class="line"></span>
|
||||
<span class="line"><span class="method">POST</span> <span class="url">http://localhost:8000/oneline-hex</span></span>
|
||||
<span class="line">hex,<span class="hex">010203</span>;</span>
|
||||
</span></span></code></pre>
|
24
integration/hurlfmt/tests_export/body.hurl
Normal file
24
integration/hurlfmt/tests_export/body.hurl
Normal file
@ -0,0 +1,24 @@
|
||||
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;
|
1
integration/hurlfmt/tests_export/body.json
Normal file
1
integration/hurlfmt/tests_export/body.json
Normal file
@ -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":"<message>Hello</message>"}}},{"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"}}}]}
|
@ -25,6 +25,10 @@
|
||||
<span class="line"><span class="string">retry</span>: <span class="number">4</span></span>
|
||||
<span class="line"><span class="string">retry-interval</span>: <span class="number">1000</span></span>
|
||||
<span class="line"><span class="string">skip</span>: <span class="boolean">false</span></span>
|
||||
<span class="line"><span class="string">variable</span>: user=<span class="null">null</span></span>
|
||||
<span class="line"><span class="string">variable</span>: status=<span class="boolean">true</span></span>
|
||||
<span class="line"><span class="string">variable</span>: count=<span class="number">2</span></span>
|
||||
<span class="line"><span class="string">variable</span>: score=<span class="number">7.7</span></span>
|
||||
<span class="line"><span class="string">variable</span>: name=<span class="string">Bob</span></span>
|
||||
<span class="line"><span class="string">verbose</span>: <span class="boolean">false</span></span>
|
||||
<span class="line"><span class="string">very-verbose</span>: <span class="boolean">false</span></span>
|
||||
|
@ -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
|
||||
|
@ -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}}"}]}}]}
|
||||
|
19
integration/hurlfmt/tests_export/predicate_value.html
Normal file
19
integration/hurlfmt/tests_export/predicate_value.html
Normal file
@ -0,0 +1,19 @@
|
||||
<pre><code class="language-hurl"><span class="hurl-entry"><span class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/predicate-value</span></span>
|
||||
</span><span class="response"><span class="line"><span class="version">HTTP</span> <span class="number">200</span></span>
|
||||
<span class="line"><span class="section-header">[Asserts]</span></span>
|
||||
<span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.null"</span> <span class="predicate-type">==</span> <span class="null">null</span></span>
|
||||
<span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.boolean"</span> <span class="predicate-type">==</span> <span class="boolean">true</span></span>
|
||||
<span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.integer"</span> <span class="predicate-type">==</span> <span class="number">2</span></span>
|
||||
<span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.float"</span> <span class="predicate-type">==</span> <span class="number">2.5</span></span>
|
||||
<span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.string"</span> <span class="predicate-type">==</span> <span class="string">"Hello"</span></span>
|
||||
<span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.template"</span> <span class="predicate-type">==</span> <span class="string">"Hello {{name}}!"</span></span>
|
||||
<span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.multiline_string"</span> <span class="predicate-type">==</span> <span class="multiline">```</span></span>
|
||||
<span class="multiline"><span class="line">Hello</span>
|
||||
<span class="line">Bob!</span>
|
||||
<span class="line">```</span></span>
|
||||
<span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.hex"</span> <span class="predicate-type">==</span> hex,<span class="hex">010203</span>;</span>
|
||||
<span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.base64"</span> <span class="predicate-type">==</span> base64,<span class="base64">bGluZTEKbGluZTINCmxpbmUzCg==</span>;</span>
|
||||
<span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.file"</span> <span class="predicate-type">==</span> file,<span class="filename">data.bin</span>;</span>
|
||||
<span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.expression"</span> <span class="predicate-type">==</span> <span class="expr">{{expression}}</span></span>
|
||||
</span></span><span class="line"></span>
|
||||
</code></pre>
|
18
integration/hurlfmt/tests_export/predicate_value.hurl
Normal file
18
integration/hurlfmt/tests_export/predicate_value.hurl
Normal file
@ -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}}
|
||||
|
1
integration/hurlfmt/tests_export/predicate_value.json
Normal file
1
integration/hurlfmt/tests_export/predicate_value.json
Normal file
@ -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"}}]}}]}
|
Loading…
Reference in New Issue
Block a user