elixir-wallaby / wallaby

Concurrent browser tests for your Elixir web apps.
https://twitter.com/elixir_wallaby
MIT License
1.68k stars 198 forks source link

feat: allow to slow down browser actions #788

Open bagrat opened 3 months ago

bagrat commented 3 months ago

For cases mentioned in https://github.com/elixir-wallaby/wallaby/issues/337 and in order to enable the developer to watch their test execute in a comprehensible way while developing, I've added the :slow_down config option to implement that feature.

I'm not sure how to test this automatically, but open for suggestions and recommendations. I've verified this manually.

mhanberg commented 3 months ago

Hi! I have a couple questions/comments

Q: Are there any similar features in similar libraries for other languages?

C: this is just implemented in the chrome driver adapter, it would need to be useable for all adapters

C: features like this should be implemented in a way that you can pass the option to start_session, and fall back to app config, then fall back to a default. And in this case, potentially even pass it to individual functions

bagrat commented 3 months ago

Hey, thanks for a quick response!

Q: Are there any similar features in similar libraries for other languages?

Yes, I've used them both in Puppeteer and Playwright before, it's called slowMo.

C: this is just implemented in the chrome driver adapter, it would need to be useable for all adapters

Could you possible point me in the right direction where this delay should also be put in?

C: features like this should be implemented in a way that you can pass the option to start_session, and fall back to app config, then fall back to a default. And in this case, potentially even pass it to individual functions

In chrome.ex and selenium.ex?