testing

2023-09-29T20:47:09.638459Z

What do people recommend these days for automated browser testing? So far, we’ve been using Cypress with cypress-clojurescript-preprocessor, but that combo is stuck at an old version, doesn’t sound like it’ll get big updates, and I’d rather have a solution that allows us to create tests repl-driven.

respatialized 2023-09-29T21:12:39.985179Z

https://github.com/clj-commons/etaoin I like etaoin quite a bit, it's very simple and very data-driven - I think you'll find it pretty REPL friendly.

👍 1
Phillip Mates 2023-09-29T21:26:34.591319Z

for a while we had repl-driven playwright tests in clojurescript via nbb. It was pretty cool but we eventually opted to go for pure js playwright tests because the tooling is much better. No repl but I haven't really missed it much for our use-case. clerk is an open source example of nbb + cljs playwright tests (https://github.com/nextjournal/clerk/blob/main/ui_tests/playwright_tests.cljs). It isn't a very complex test suite (just loads a page to see if there is an error) but if you go this route I can dig up more examples from a non-open project if that is helpful I haven't used any other browser test setups but using playwright has had a substantial positive effect on the stability of our code-base

👍 1
pesterhazy 2023-09-30T08:30:23.965059Z

We also use js for cypress. It's ok – it's more of a dsl than code anyway.

pesterhazy 2023-09-30T08:31:46.048139Z

I don't love cypress; it's too much magic and issues can be hard to debug. If I were to start over, I'd pick playwright

👍 1
pesterhazy 2023-09-30T08:34:23.515219Z

By the way, make sure you don't rely too much on browser automation for testing. Other types of tests are faster and cheaper and don't rely on the idiosyncrasies of Chrome

💯 1
2023-09-30T10:33:18.451389Z

Thank you for your recommendations! I’m also curious about https://taiko.dev. Anybody looked into that yet? Maybe it could be paired with https://github.com/squint-cljs/squint.