Altinn / app-frontend-react

Altinn application React frontend
BSD 3-Clause "New" or "Revised" License
16 stars 27 forks source link

Cypress tests for new PDF generator #865

Open olemartinorg opened 1 year ago

olemartinorg commented 1 year ago

In #861 I took a mental note that automatic PDF generation might not work after my (extensive) changes. Sadly, PDF crashes immediately, but no cypress test ever alerted me of that fact.

olemartinorg commented 1 year ago

@bjosttveit I thought of this, in relation to the new Percy tests.. Right now I've restructured so that all-process-steps.ts is the only test setting the cookie to generate PDFs on the frontend-test app. And, it tests that the files are present in the receipt. What if we download those files, identify which process step each of them are for, display them in the browser (using pdf.js if Cypress isn't able to) and perform a snapshot so that Percy can notify us if there's differences?

To achieve this, I think we'll need:

What do you think? I think that would help to get some test coverage for these generated PDFs.

bjosttveit commented 1 year ago

Sounds good to me!