I played with Cypress (and ERM and Vue)
Hi devs, Following my previous email here, I have started to work on the ERM project and wanted to try Vue in a more complex example. You can find the whole tree at https://gitlab.com/joubu/Koha/-/commits/erm It contains CRUD operations for ERM's agreement (can link users and periods), all based on Vue requesting our REST API routes, and covered by tests using Cypress. Feedback welcome! Cheers, Jonathan
I don't think I've heard of the ERM project so I'm not sure what to look at, but that's cool about using Cypress. I use Puppeteer and Playwright on some other projects (purely for automation and not testing), and Cypress came up when I was looking in that space. If you have some instructions on how to try it out, I wouldn't mind looking at this from a user perspective. David Cook Senior Software Engineer Prosentient Systems Suite 7.03 6a Glen St Milsons Point NSW 2061 Australia Office: 02 9212 0899 Online: 02 8005 0595 -----Original Message----- From: Koha-devel <koha-devel-bounces@lists.koha-community.org> On Behalf Of Jonathan Druart Sent: Thursday, 17 March 2022 3:24 AM To: koha-devel <koha-devel@lists.koha-community.org> Subject: [Koha-devel] I played with Cypress (and ERM and Vue) Hi devs, Following my previous email here, I have started to work on the ERM project and wanted to try Vue in a more complex example. You can find the whole tree at https://gitlab.com/joubu/Koha/-/commits/erm It contains CRUD operations for ERM's agreement (can link users and periods), all based on Vue requesting our REST API routes, and covered by tests using Cypress. Feedback welcome! Cheers, Jonathan _______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : https://www.koha-community.org/ git : https://git.koha-community.org/ bugs : https://bugs.koha-community.org/
Hi David, The ERM (for Electronic Resource Management) project has been announced on the general mailing list https://lists.katipo.co.nz/pipermail/koha/2022-February/057447.html I also talked a bit about it at the last dev meeting. In short, BibLibre, ByWaterSolutions and PTFS-e are sponsoring me to implement an ERM module in Koha. I wanted to take that opportunity to start with something new, hence my last "I played with" emails on this list, about React and Vue. About the remote branch, did you have a look at the (very) succinct commit messages? They are self-explanatory :) A test plan could be: - Run `yarn build_js` - Turn on the new syspref ERMModule - Be a librarian with the new "erm" permission, or superlibrarian - Go to Electronic resources management > Agreements - Add, edit, delete agreements, add/edit/delete them periods and users. - Run the tests with `yarn run cypress open` (from the host, not inside a container, you need a graphic server) Cheers, Jonathan Le mer. 16 mars 2022 à 23:48, <dcook@prosentient.com.au> a écrit :
I don't think I've heard of the ERM project so I'm not sure what to look at, but that's cool about using Cypress. I use Puppeteer and Playwright on some other projects (purely for automation and not testing), and Cypress came up when I was looking in that space.
If you have some instructions on how to try it out, I wouldn't mind looking at this from a user perspective.
David Cook Senior Software Engineer Prosentient Systems Suite 7.03 6a Glen St Milsons Point NSW 2061 Australia
Office: 02 9212 0899 Online: 02 8005 0595
-----Original Message----- From: Koha-devel <koha-devel-bounces@lists.koha-community.org> On Behalf Of Jonathan Druart Sent: Thursday, 17 March 2022 3:24 AM To: koha-devel <koha-devel@lists.koha-community.org> Subject: [Koha-devel] I played with Cypress (and ERM and Vue)
Hi devs,
Following my previous email here, I have started to work on the ERM project and wanted to try Vue in a more complex example.
You can find the whole tree at https://gitlab.com/joubu/Koha/-/commits/erm
It contains CRUD operations for ERM's agreement (can link users and periods), all based on Vue requesting our REST API routes, and covered by tests using Cypress.
Feedback welcome!
Cheers, Jonathan _______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : https://www.koha-community.org/ git : https://git.koha-community.org/ bugs : https://bugs.koha-community.org/
It is a great development! This ERM feature is surely an enrichment for Koha. ________________________________ Van: Koha-devel <koha-devel-bounces@lists.koha-community.org> namens Jonathan Druart <jonathan.druart@bugs.koha-community.org> Verzonden: donderdag 17 maart 2022 09:06 Aan: David Cook <dcook@prosentient.com.au> CC: koha-devel <koha-devel@lists.koha-community.org> Onderwerp: Re: [Koha-devel] I played with Cypress (and ERM and Vue) Hi David, The ERM (for Electronic Resource Management) project has been announced on the general mailing list https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.kati... I also talked a bit about it at the last dev meeting. In short, BibLibre, ByWaterSolutions and PTFS-e are sponsoring me to implement an ERM module in Koha. I wanted to take that opportunity to start with something new, hence my last "I played with" emails on this list, about React and Vue. About the remote branch, did you have a look at the (very) succinct commit messages? They are self-explanatory :) A test plan could be: - Run `yarn build_js` - Turn on the new syspref ERMModule - Be a librarian with the new "erm" permission, or superlibrarian - Go to Electronic resources management > Agreements - Add, edit, delete agreements, add/edit/delete them periods and users. - Run the tests with `yarn run cypress open` (from the host, not inside a container, you need a graphic server) Cheers, Jonathan Le mer. 16 mars 2022 à 23:48, <dcook@prosentient.com.au> a écrit :
I don't think I've heard of the ERM project so I'm not sure what to look at, but that's cool about using Cypress. I use Puppeteer and Playwright on some other projects (purely for automation and not testing), and Cypress came up when I was looking in that space.
If you have some instructions on how to try it out, I wouldn't mind looking at this from a user perspective.
David Cook Senior Software Engineer Prosentient Systems Suite 7.03 6a Glen St Milsons Point NSW 2061 Australia
Office: 02 9212 0899 Online: 02 8005 0595
-----Original Message----- From: Koha-devel <koha-devel-bounces@lists.koha-community.org> On Behalf Of Jonathan Druart Sent: Thursday, 17 March 2022 3:24 AM To: koha-devel <koha-devel@lists.koha-community.org> Subject: [Koha-devel] I played with Cypress (and ERM and Vue)
Hi devs,
Following my previous email here, I have started to work on the ERM project and wanted to try Vue in a more complex example.
You can find the whole tree at https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.com...
It contains CRUD operations for ERM's agreement (can link users and periods), all based on Vue requesting our REST API routes, and covered by tests using Cypress.
Feedback welcome!
Cheers, Jonathan _______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.koha... website : https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.koha-c... git : https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.koha-c... bugs : https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugs.koha-...
_______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.koha... website : https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.koha-c... git : https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.koha-c... bugs : https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugs.koha-...
That's exciting to hear! I'll make some time this afternoon to give this a go. David Cook Senior Software Engineer Prosentient Systems Suite 7.03 6a Glen St Milsons Point NSW 2061 Australia Office: 02 9212 0899 Online: 02 8005 0595 -----Original Message----- From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Sent: Thursday, 17 March 2022 7:07 PM To: David Cook <dcook@prosentient.com.au> Cc: koha-devel <koha-devel@lists.koha-community.org> Subject: Re: [Koha-devel] I played with Cypress (and ERM and Vue) Hi David, The ERM (for Electronic Resource Management) project has been announced on the general mailing list https://lists.katipo.co.nz/pipermail/koha/2022-February/057447.html I also talked a bit about it at the last dev meeting. In short, BibLibre, ByWaterSolutions and PTFS-e are sponsoring me to implement an ERM module in Koha. I wanted to take that opportunity to start with something new, hence my last "I played with" emails on this list, about React and Vue. About the remote branch, did you have a look at the (very) succinct commit messages? They are self-explanatory :) A test plan could be: - Run `yarn build_js` - Turn on the new syspref ERMModule - Be a librarian with the new "erm" permission, or superlibrarian - Go to Electronic resources management > Agreements - Add, edit, delete agreements, add/edit/delete them periods and users. - Run the tests with `yarn run cypress open` (from the host, not inside a container, you need a graphic server) Cheers, Jonathan Le mer. 16 mars 2022 à 23:48, <dcook@prosentient.com.au> a écrit :
I don't think I've heard of the ERM project so I'm not sure what to look at, but that's cool about using Cypress. I use Puppeteer and Playwright on some other projects (purely for automation and not testing), and Cypress came up when I was looking in that space.
If you have some instructions on how to try it out, I wouldn't mind looking at this from a user perspective.
David Cook Senior Software Engineer Prosentient Systems Suite 7.03 6a Glen St Milsons Point NSW 2061 Australia
Office: 02 9212 0899 Online: 02 8005 0595
-----Original Message----- From: Koha-devel <koha-devel-bounces@lists.koha-community.org> On Behalf Of Jonathan Druart Sent: Thursday, 17 March 2022 3:24 AM To: koha-devel <koha-devel@lists.koha-community.org> Subject: [Koha-devel] I played with Cypress (and ERM and Vue)
Hi devs,
Following my previous email here, I have started to work on the ERM project and wanted to try Vue in a more complex example.
You can find the whole tree at https://gitlab.com/joubu/Koha/-/commits/erm
It contains CRUD operations for ERM's agreement (can link users and periods), all based on Vue requesting our REST API routes, and covered by tests using Cypress.
Feedback welcome!
Cheers, Jonathan _______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : https://www.koha-community.org/ git : https://git.koha-community.org/ bugs : https://bugs.koha-community.org/
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-choo... 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/t... 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
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@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-choo...
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/t...
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
participants (4)
-
dcook@prosentient.com.au -
Jonathan Druart -
Marcel de Rooy -
Victor Grousset/tuxayo