Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hurlfmt update html output #261

Merged
merged 5 commits into from
Sep 25, 2021
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
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,10 @@ jobs:
run: |
export PATH="$PWD/target/debug:$PATH"
cd integration
pip install lxml bs4
./integration.py
./test_curl_commands.sh tests/*.curl
./test_html_output.py tests/*.html
xmllint --noout tests/*.html
- name: Archive production artifacts
uses: actions/upload-artifact@v2
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion integration/integration.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python3
import sys
import glob
import test_echo
import test_lint
Expand Down
2 changes: 1 addition & 1 deletion integration/report/html/index.html

Large diffs are not rendered by default.

50 changes: 45 additions & 5 deletions integration/report/html/tests/assert_base64.hurl.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
}

span.line {
display: block;
line-height: 1.2rem;
}

Expand All @@ -33,7 +32,7 @@
.version {
color: black;
}
.status {
.number {
color: blue;
}
.section-header {
Expand All @@ -44,17 +43,58 @@
color: teal;
}

.subquery-type {
color: darkblue;
}

.not {
color: darkblue;
}

.predicate-type {
color: darkblue;
}

.string {
color: darkgreen;
}

.raw {
color: darkgreen;
}
.comment {
color: dimgray;
}
</style></head><body>
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="comment"># Test body response with line ending LF and CRLF.</span></span><span class="line"><span class="comment"># We receive the text body "line1\nline2\r\nline3\n"</span></span><span class="line"><span class="comment">#</span></span><span class="line"><span class="comment"># $ printf "line1\nline2\r\nline3\n" | base64</span></span><span class="line"><span class="comment"># bGluZTEKbGluZTINCmxpbmUzCg==</span></span><span class="line"></span><span class="line"></span><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/assert-base64</span></span></div><div class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span><span class="line"><span>base64,bGluZTEKbGluZTINCmxpbmUzCg==;</span></span></div></div><span class="line"></span></div>
.name {
color: darkgreen;
}
.json {
color: darkgreen;
}
.xml {
color: darkgreen;
}
.base64 {
color: darkgreen;
}
.hex {
color: darkgreen;
}
.filename {
color: darkgreen;
}
.cookie-value {
color: darkgreen;
}</style></head><body>
<pre><code class="language-hurl"><span class="hurl-entry"><span class="request"><span class="line"></span><span class="comment"># Test body response with line ending LF and CRLF.</span>
<span class="line"></span><span class="comment"># We receive the text body "line1\nline2\r\nline3\n"</span>
<span class="line"></span><span class="comment">#</span>
<span class="line"></span><span class="comment"># $ printf "line1\nline2\r\nline3\n" | base64</span>
<span class="line"></span><span class="comment"># bGluZTEKbGluZTINCmxpbmUzCg==</span>
<span class="line"></span>
<span class="line"></span>
<span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/assert-base64</span></span>
</span><span class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="number">200</span></span>
<span class="line">base64,<span class="base64">bGluZTEKbGluZTINCmxpbmUzCg==</span>;</span>
</span></span><span class="line"></span>
</code></pre>
</body></html>
52 changes: 47 additions & 5 deletions integration/report/html/tests/assert_header.hurl.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
}

span.line {
display: block;
line-height: 1.2rem;
}

Expand All @@ -33,7 +32,7 @@
.version {
color: black;
}
.status {
.number {
color: blue;
}
.section-header {
Expand All @@ -44,17 +43,60 @@
color: teal;
}

.subquery-type {
color: darkblue;
}

.not {
color: darkblue;
}

.predicate-type {
color: darkblue;
}

.string {
color: darkgreen;
}

.raw {
color: darkgreen;
}
.comment {
color: dimgray;
}
</style></head><body>
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/assert-header</span></span></div><div class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span><span class="line"><span class="string">Content-Type</span><span>:</span> <span class="string">text/html; charset=utf-8</span></span><span class="line"><span class="string">Set-Cookie</span><span>:</span> <span class="string">cookie1=value1; Path=/</span></span><span class="line"><span class="string">Set-Cookie</span><span>:</span> <span class="string">cookie2=value2; Path=/</span></span><span class="line section-header">[Asserts]</span><span class="line"><span class="query-type">header</span> <span class="string">"Custom"</span> not <span class="predicate-type">exists</span></span><span class="line"><span class="query-type">header</span> <span class="string">"Content-Type"</span> <span class="predicate-type">exists</span></span><span class="line"><span class="query-type">header</span> <span class="string">"Header1"</span> <span class="predicate-type">equals</span> <span class="string">"value1"</span></span><span class="line"><span class="query-type">header</span> <span class="string">"ETag"</span> <span class="predicate-type">equals</span> <span class="string">""33a64df551425fcc55e4d42a148795d9f25f89d4""</span></span><span class="line"><span class="query-type">header</span> <span class="string">"Set-Cookie"</span> <span class="predicate-type">exists</span></span><span class="line"><span class="query-type">header</span> <span class="string">"Set-Cookie"</span> <span class="query-type">count</span> <span class="predicate-type">==</span> <span class="number">3</span></span><span class="line"><span class="query-type">header</span> <span class="string">"Set-Cookie"</span> <span class="predicate-type">includes</span> <span class="string">"cookie1=value1; Path=/"</span></span><span class="line"><span class="query-type">header</span> <span class="string">"Set-Cookie"</span> not <span class="predicate-type">includes</span> <span class="string">"cookie4=value4; Path=/"</span></span></div></div></div>
.name {
color: darkgreen;
}
.json {
color: darkgreen;
}
.xml {
color: darkgreen;
}
.base64 {
color: darkgreen;
}
.hex {
color: darkgreen;
}
.filename {
color: darkgreen;
}
.cookie-value {
color: darkgreen;
}</style></head><body>
<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/assert-header</span></span>
</span><span class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="number">200</span></span>
<span class="line"><span class="string">Content-Type</span><span>:</span> <span class="string">text/html; charset=utf-8</span></span>
<span class="line"><span class="string">Set-Cookie</span><span>:</span> <span class="string">cookie1=value1; Path=/</span></span>
<span class="line"><span class="string">Set-Cookie</span><span>:</span> <span class="string">cookie2=value2; Path=/</span></span>
<span class="line section-header">[Asserts]</span>
<span class="line"><span class="query-type">header</span> <span class="string">"Custom"</span> <span class="not">not</span> <span class="predicate-type">exists</span></span>
<span class="line"><span class="query-type">header</span> <span class="string">"Content-Type"</span> <span class="predicate-type">exists</span></span>
<span class="line"><span class="query-type">header</span> <span class="string">"Header1"</span> <span class="predicate-type">equals</span> <span class="string">"value1"</span></span>
<span class="line"><span class="query-type">header</span> <span class="string">"ETag"</span> <span class="predicate-type">equals</span> <span class="string">"\"33a64df551425fcc55e4d42a148795d9f25f89d4\""</span></span>
<span class="line"><span class="query-type">header</span> <span class="string">"Set-Cookie"</span> <span class="predicate-type">exists</span></span>
<span class="line"><span class="query-type">header</span> <span class="string">"Set-Cookie"</span> <span class="subquery-type">count</span> <span class="predicate-type">==</span> <span class="number">3</span></span>
<span class="line"><span class="query-type">header</span> <span class="string">"Set-Cookie"</span> <span class="predicate-type">includes</span> <span class="string">"cookie1=value1; Path=/"</span></span>
<span class="line"><span class="query-type">header</span> <span class="string">"Set-Cookie"</span> <span class="not">not</span> <span class="predicate-type">includes</span> <span class="string">"cookie4=value4; Path=/"</span></span></span></span></code></pre>
</body></html>
Loading