Skip to content

Commit

Permalink
✅ Test PDF generation
Browse files Browse the repository at this point in the history
Only a basic one for now, with default parameters
  • Loading branch information
foosel committed May 25, 2024
1 parent 1d692f1 commit ab176cf
Show file tree
Hide file tree
Showing 6 changed files with 917 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,17 @@ jobs:
run: |
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
npx playwright install-deps
- name: 🏗 Install extra PDF compare dependencies
run: |
sudo apt-get update
sudo apt-get install graphicsmagick
sudo apt-get install imagemagick
sudo apt-get install ghostscript
# Change ImageMagick policy to allow pdf -> png conversion
sudo sed -i 's/^.*policy.*coder.*none.*PDF.*//' /etc/ImageMagick-6/policy.xml
- name: 🎭 Run Playwright
working-directory: ./tests
run: |
Expand Down
Binary file added tests/files/test-pdf.foldable.pdf
Binary file not shown.
3 changes: 3 additions & 0 deletions tests/fixtures.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ const testPdf = {
query: "grid-count-x=3&grid-count-y=3&grid-width=40&grid-height=40&grid-start-x=0&grid-start-y=0&grid-margin-x=0&grid-margin-y=0&grid-cut-margin=0",
preset: {"grid-count-x":"3","grid-count-y":"3","grid-width":"40","grid-height":"40","grid-start-x":"0","grid-start-y":"0","grid-margin-x":"0","grid-margin-y":"0","grid-cut-margin":"0","grid-step-size":"0.1","cards-backs":"fileall","cards-rotate-backs":false,"_key":"test-pdf","_name":"Test PDF"},
path: "./files/test-pdf.pdf",
filename: "test-pdf.pdf",
outputPath : "./files/test-pdf.foldable.pdf",
outputFilename: "test-pdf.foldable.pdf"
}

exports.test = base.test.extend({
Expand Down
Loading

0 comments on commit ab176cf

Please sign in to comment.