Back to articles
WICK-DOM-OBSERVER: The Deterministic Cypress Plugin for Fast Spinners, Blinking Toasts, Optional Overlays, and UI’s Most Wanted

WICK-DOM-OBSERVER: The Deterministic Cypress Plugin for Fast Spinners, Blinking Toasts, Optional Overlays, and UI’s Most Wanted

via Dev.toSebastian Clavijo Suero

Because the most dangerous UI behaviors are the ones that leave almost no trace. ACT 1: EXPOSITION There are some UI elements that seem to exist for one noble purpose only: to make your Cypress tests miserable. I am talking about the spinner that appears and disappears so absurdly fast that by the time Cypress gets there, it is already gone. The toast that politely informs the user that something happened, but only for a tiny and inconvenient window of time. And, of course, the annoying modal or overlay that shows up on page load only when it feels like it, blocks the whole page, and leaves your test suite wondering whether it should close it... or pretend it never existed. These are not exotic edge cases. These are real UI behaviors we deal with all the time. And the worst part is not even testing them. The worst part is testing them reliably . Because traditional approaches usually push you toward one of these painful paths: cy.wait(500) and pray. Force the UI to behave unnaturally j

Continue reading on Dev.to

Opens in a new tab

Read Full Article
8 views

Related Articles