Hi :) On 21-02-01 05:08, dcook@prosentient.com.au wrote:
What do people think about doing our cross-browser automated testing in Javascript rather than Perl? We’re already using Node.js for generating Koha’s CSS: https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff... <https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_interface>.
I’ve been playing with Puppeteer and Playwright lately for non-test related browser automation, and they’re pretty easy to work with. Playwright is based on Puppeteer, and their basic APIs are the same, so fairly interchangeable. (We’d need to use another library like Jest or Playwright-test to do the test evaluation.)
It looks like we only have 6 files that use Selenium, so it wouldn’t be a big drama to replace them.
Thanks for you exploration work :D I don't think I can help much in setting up the test stack **but** I can rewrite all the tests in whatever the community see fit. Though I don't really know what would be the gains in practice of switching to Playwright compared to staying with Selenium via Perl. Or switching to Selenium via JavaScript if our Perl lib gives troubles. No opinion for now. About our Selenium Perl lib, it's still being maintained with good work in progress to support the upcoming Selenium 4 https://github.com/teodesian/Selenium-Remote-Driver/issues/452#issuecomment-... Is Puppeteer needed in a stack using Playwright? Because it's centered on Chromium, it's already a good surprise that Google worked to bring experimental Firefox support. But it's hard to bet that it will get stable and still be maintained for years. https://github.com/puppeteer/puppeteer/#q-what-is-the-status-of-cross-browse...
There is a Perl library https://metacpan.org/pod/Playwright <https://metacpan.org/pod/Playwright> but it’s just a wrapper around Playwright anyway and it’s so new that I’d be a bit wary of using it.
If the tests are to be rewritten to use Playwright, +1 to do that in JS rather than Perl to avoid depending on an unofficial lib. -- Victor Grousset/tuxayo