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
5 changes: 4 additions & 1 deletion .github/workflows/pr_visual_flow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ jobs:
name: test-visual-images
path: |
/home/runner/work/_temp/**/*.png
/home/runner/work/_temp/**/*.docx
/home/runner/work/_temp/**/*.pdf
target/surefire-reports/*.xml
- name: Test Report
uses: dorny/test-reporter@v1
uses: dorny/test-reporter@v2
if: success() || failure()
with:
name: Visual Tests
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified test-resources/multipart/expected.pdf
Binary file not shown.
4 changes: 3 additions & 1 deletion test/stencil/integration.clj
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@
data :data
expected-pdf-file :expected
fragments :fragments
label :label
fix? :fix?}]
(let [basename (str (str (.getName (io/file expected-pdf-file)) "-base"))
outdir (io/file (or (System/getenv "RUNNER_TEMP") "/tmp") "stencil-testing")
outdir (io/file (or (System/getenv "RUNNER_TEMP") "/tmp")
(or label "stencil-testing"))
docx-output (io/file outdir (str basename ".result.docx"))
pdf-output (io/file outdir (str basename ".result.pdf"))
expected-pdf (io/file (io/resource expected-pdf-file))]
Expand Down
16 changes: 9 additions & 7 deletions test/stencil/visual_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@
body '[static static-styled]
header '[nil static plain styled]
:when (= (str/includes? (name main) "with-header") (some? header))]
(render-visual-compare!
:template (format "multipart-gen/main-%s.docx" main)
:data {:name "Janos"}
:expected (format "multipart-gen/expected-%s-%s-%s.pdf" main body header)
:fix? true
:fragments {"body" (format "multipart-gen/body-%s.docx" body)
"header" (when header (format "multipart-gen/header-%s.docx" header))})))
(testing (format "main=%s body=%s header=%s" main body header)
(render-visual-compare!
:template (format "multipart-gen/main-%s.docx" main)
:data {:name "Janos"}
:expected (format "multipart-gen/expected-%s-%s-%s.pdf" main body header)
:fix? true
:label (format "gen-%s-%s-%s" main body header)
:fragments {"body" (format "multipart-gen/body-%s.docx" body)
"header" (when header (format "multipart-gen/header-%s.docx" header))}))))