top | item 46991185

(no title)

forcepushed | 17 days ago

Yes, exactly how most of experience here goes. Each test ends up becoming sort of a custom implementation to handle specific use cases around interactivity and availability.

Do you feel yourself wanting to extract this logic (wait for a selector, load state, or function evaluating etc) to some shared utility and then just pushing all of your interactions through this as a sort of feedback engine for future problems?

discuss

order

benoau|15 days ago

> to some shared utility and then just pushing all of your interactions through this

Yeah that's basically what Playwright is doing under the hood, your click is more like "wait for the element to exist and then click". Back in my puppeteer days I'd usually have my own click/etc functions wrapping everything in a try/catch and retrying.

It's very hard to balance because ultimately the solution is basically always waiting <arbitrary ms> after any interaction and that itself is dependent on how busy the CPU is which varies between local vs CI, and you blow up your running time by setting like "slowMo" to 100ms for example.