garris / BackstopJS

Catch CSS curve balls.
http://backstopjs.org
MIT License
6.66k stars 602 forks source link

Possibility of integration with Taiko #1495

Open SzajJolanta opened 11 months ago

SzajJolanta commented 11 months ago

Hello! We have a project already fully developed using Taiko framework but we want to introduce BackstopJS and visual automation to it. We were wondering about the possibility of integrating BackstopJS not only to Playwright and Puppeteer but also Taiko (all those frameworks are JS based and similar) https://taiko.dev/ https://github.com/getgauge/taiko So the question would be:

  1. Is it possible at all?
  2. Where to start, could I get a contact of some sort, to get a guidance?
garris commented 11 months ago

Hi @SzajJolanta, sure. Depending on how Taiko is built, it could be straight forward to do the integration. There is a single file in backstop for each automation driver (e.g. playwright, puppeteer), for example...

runPlaywright.js takes a single backstop scenario, passes it to the driver (playwright in this case) and waits for the driver to complete a setup and screen capture. e.g. here is the entrypoint...

https://github.com/garris/BackstopJS/blob/f0651dc5439cebc1445a611115b7c16f4d2074a4/core/util/runPlaywright.js#L46-L62

Individual driver flows are called by createBitmaps.js, here is the switch statement...

https://github.com/garris/BackstopJS/blob/f0651dc5439cebc1445a611115b7c16f4d2074a4/core/util/createBitmaps.js#L132-L155

So, that is pretty much the Backstop-related surface area you need to be concerned with. And you'd also want to update the docs and runtime-boilerplate code of course.

I am not familiar with Taiko, so, I would want to see some decent flow compatibility with Backstop in general -- since it will add complexity, I would like to know what benefits Taiko would bring to justify the enhancement -- ideally, I would expect a vanilla/default implementation to behave the same across all drivers with the differences being more in the advanced features or performance curves etc.

I don't have a lot of time to put into the project at this point -- but if you want to put in the effort to build an integration I am happy to consult occasionally on zoom or teams to answer questions and help in ways that I can. I would ask that you have other engineers review and approve your contributions and that you own any related issues that come in from the community.

Cheers.

SzajJolanta commented 10 months ago

Hello! Thank you for your fast reply, it was very helpful. We are consulting the possibilities within the team and will let you know on the progress.

Jola