[Koha-devel] I played with Cypress (and ERM and Vue)

Jonathan Druart jonathan.druart at bugs.koha-community.org
Wed Mar 23 10:46:41 CET 2022


> Nice to hear that. How was coding UI tests compared to Selenium?

It's easier to write and easier to debug (given the screenshot and the
ability to inspect the DOM after each test).

> And the API tests compared to the current way?

Please have a look at the patch, or at least the very succinct commit
messages "We are mocking the REST API routes responses", so they are
not tested with Cypress in this patch. If we are not mocking the
routes, they won't replace the existing tests as it will become
end-to-end integration tests. Both will be useful.

> ... was not impressive compared to Puppeteer and Playwright.

Yes, there is always another alternative, but no code to show me the comparison.

> I think the workaround wouldn't work for us since our pop up are
> used to fill a field in the calling window

Yes, I know, there is a TODO in the code. I was planning to have a
modal instead, which would be nice, but that was too many changes.
If it's the only problem, it should not block us from choosing
Cypress. We don't have many pop-ups, and I don't think we are already
testing them anyway.

Le mer. 23 mars 2022 à 02:58, Victor Grousset/tuxayo
<victor at tuxayo.net> a écrit :
>
> Hi :)
>
> Nice to hear that. How was coding UI tests compared to Selenium?
> And the API tests compared to the current way?
> It's good that Cypress provides an alternative to both.
>
> The Cypress section of this comparison with Puppeteer, Selenium, and
> Playwright was not impressive compared to Puppeteer and Playwright.
> https://www.testim.io/blog/puppeteer-selenium-playwright-cypress-how-to-choose/
>
> And it seems some parts of Koha (with pop up windows) wouldn't be
> testable with Cypress :o
> https://docs.cypress.io/guides/references/trade-offs#Multiple-tabs
> and I think the workaround wouldn't work for us since our pop ups are
> used to fill a field in the calling window:
> https://github.com/cypress-io/cypress-example-recipes/tree/master/examples/testing-dom__tab-handling-links
>
> Also about iframes, with Firefox, Cypress can't at all interact inside
> them. Could that be an issue if one day we want to use Cypress in Koha?
> Given that Koha has a few minor iframes.
>
> But it's the only Selenium alternative in the 3 to have a community
> development. As opposed to Puppeteer and Playwright being developed >95%
> by Google and Microsoft respectively. So who knows if one of the two has
> so much success that Google or Microsoft drops their efforts on
> maintaining the other one. Or one looses traction. It's not the first
> time they would drop support to a project[1] and Firefox support should
> be expected to always be precarious. (it's still experimental for Puppeteer)
> On the other hand it's libre/open source so we can hope on the long term
> there will always be a community to do the minimal maintenance. Hard to
> say about Firefox support though.
>
> [1] There is some dev stuff the following lists. Not enough to be
> certain of the risks. (So I'm might be spreading FUD due to GAFAM
> allergy) But enough to be wary about projects whose top committers are
> from a single company. Which totally have the right to change their
> priorities, no issues with that.
> https://killedbygoogle.com/
> https://killedbymicrosoft.info/
>
>
> Cheers,
>
> --
> Victor Grousset/tuxayo


More information about the Koha-devel mailing list