I would like to share a new Robot Framework Library with you, that I just released.
It’s a library for visual document testing and the concept is pretty simple:
It loads two documents (e.g. PDF files) and compares them visually.
If they are equal - passed. If they differ - failed.
We use it in our company to test our central output management system after a new release.
To make sure that changes don’t have any “unwanted” effects on the generated outputs.
It has some useful features, like masking parts of the document (pased on text patterns or position) or even accepting small visual differents (like moved areas/texts within a defined range).
It can also check some properties of .pcl and .postscript files, but I guess that’s a very ‘specific’ functionality for our company.
It has a LOT of dependencies (like OpenCV, Tesseract, PyWand, …) so I definitely recommend to install it in a virtual python environment.
Some binaries need to be installed separately (Tesseract-OCR, ImageMagick, Ghostscript, …) but it’s all described in the ReadMe.
A Docker Image will also be provided, until then feel free to build your own container using the included Dockerfile.
It’s still in a very early stage, but the basic functionality (simple comparisons with masks) is working in a reliable way.
As you might see, the reference file and the candidate will be of different resolution. The problem i’m facing with this is, that the Mask is not resized/converted correctly for the candidate file and thus this kind of combination seems impossible to achieve with Compare Images keyword atm.
Is this a bug, i would really need this. The problem lies in the fact that i make the tests locally on my laptop which eventually has different resolution compared to when i run the tests in Azure pipeline. I run the tests headlesschorme and set the browser window size staticly Set Window Size 1920 1080
but still the images i get locally are over 1920x1080 in resolution while the azure pipeline images are 1904x933 in size.
Thats an interesting constellation.
The expectation is, that the mask is scaled in the same factor as the candidate file is scaled to the reference image, correct?
I think that should be simple to implement.
Will you support the testing of that change?
ok, I’m working on it and I realized that I made a silly design decision which makes this change a little bit harder to implement than it should be.
But I should have a prerelase soon that you can try.