[LRUG] Testing PDFs

Craig Webster craig at barkingiguana.com
Tue Aug 1 12:12:19 PDT 2017


Hello!

Maybe consider something like Wraith or Gatling to do diffs on screenshots of the PDF:

  http://bbc-news.github.io/wraith/ <http://bbc-news.github.io/wraith/>
  https://github.com/gabrielrotbart/gatling <https://github.com/gabrielrotbart/gatling>

Not sure quite how it’ll work with PDFs - think they’re normally aimed at HTML/CSS/JS, but this is where I’d start.

Good luck - and let us know how you get on!

C
--
Barking Iguana Ltd. is a company registered in England and Wales.
Registered number: 08915147. Registered address: Jubilee House, East Beach, Lytham, St. Annes, Lancashire, England, FY8 5FT.

> On 1 Aug 2017, at 20:00, Mark Burns <markthedeveloper at gmail.com> wrote:
> 
> Has anyone any recommendations or suggestions for testing PDF generation?
> 
> I'm working on a side project and using Prawn. Which is great. I can programmatically generate large aspects of the content I want.
> 
> But so far I've been tweaking then looking at the result in the browser.
> It's not an absolute nightmare - a few seconds to render. But it's hard to know whether the result is working without actually looking at it.
> 
> The DSL is nice, but very imperative. Mocking method calls out would be insane.
> 
> I'm managing to refactor into small objects to represent the components and layout, pages, typography aspects etc of the document. Which brings the complexity back down to manageable chunks. 
> 
> But ultimately everything just calls underlying prawn DSL methods. So I can test little bits of logic that I have in my objects, but ultimately whether it works or not comes down to "have a look and see".
> 
> Perhaps the best I can hope for is screenshotting when I'm happy and using approvals to verify each major change hasn't radically borked everything.
> 
> It seems like there are tools to test which strings get into the document, but that seems like the easiest part. And probably the only part I'd be happy with test doubles for prawn and setting expectations on the text generating methods.
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> Archives: http://lists.lrug.org/pipermail/chat-lrug.org
> Manage your subscription: http://lists.lrug.org/options.cgi/chat-lrug.org
> List info: http://lists.lrug.org/listinfo.cgi/chat-lrug.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20170801/b66fd0ad/attachment-0002.html>


More information about the Chat mailing list