checkly / public-roadmap

Checkly public roadmap. All planned features, updates and tweaks.
https://checklyhq.com
37 stars 7 forks source link

Support for toHaveScreenshot using artifact management / Add a visual comparison NPM package to runtimes #282

Open jonoc330 opened 1 year ago

jonoc330 commented 1 year ago

Is your feature request related to a problem? Please describe. I have a particular use case for toHaveScreenshot in that my Checkly tests goes through our UI to generate a PDF export of a particular page that you're on. I'd love to be able to compare a screenshot of the PDF generated to a snapshot, as it's impossible to run typical assertions on the information shown in PDFs.

Describe the solution you'd like I understand that Checkly agents run in an isolated environment for each test. However, toHaveScreenshot could be supported in a way similar to Buildkite in how it allows you to manage artifacts between builds and build steps, it would be cool if the Checkly agent could detect snapshots generated from toHaveScreenshot, store them somewhere, and then pull them down for the next test to verify against. This could be automatic, or something that the test does, wherer you test can import some kind of Checkly npm package that exports some functions to do these particular tasks.

Describe alternatives you've considered What I'm trying to achieve here I can write this code myself. I.e i can store the screenshot snapshots in S3 at the end of my test and write them to disk when the test starts again but that's not ideal at scale if I need to do this in multiple tests. There are visual comparison libraries out there but they aren't in the Checkly runtimes. Adding some kind of visual comparison npm package to the runtimes would suffice too!!!

tnolet commented 1 year ago

@jonoc330 thanks for suggesting this. Screenshot testing and visual testing is supported in Playwright and we want to look into it and see if/how/when we can support this in a way that makes sense. No ETA yet, but we it has our attention: we are thinking all day long how we can make our Playwright support amazing.