~/talk

Gaining Confidence with Cypress Tests

Talkat NDC London 2021 · 2021-01-25..01-29· [testing, developer-experience]
slides:none on file

Cypress is a browser plugin that runs JavaScript/TypeScript end-to-end tests faster and less brittle by waiting on real browser events instead of fixed sleeps; examples run against TodoMVC and a Hacker News PWA, tests pass locally and in CI (Chrome/Firefox/Edge) with video/screenshots and junit outputs. Key techniques shown: time-traveling IDE to step through DOM snapshots, cy.intercept with fixtures to stub API responses and custom cy commands plus data-cy attributes for readable, reusable tests; note forced clicks for hidden elements and limited Safari support.

AI-written summary · about

  1. 0:00Start
  2. 7:41End-to-end Testing Frameworks: Selenium
  3. 9:09Cypress Electron app and browser plugin
  4. 10:38Test Cafe Browser plugin, by DevExpress Cons
  5. 41:56Best Practices Don't use text, use consistent selectors: • id, class Even better, use test-specific attributes
  6. 44:01Best Practices Don't login with the Ul at the beginning of each test (slow) Instead: create one login Ul test
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.