It's a (Testing) Trap! - Common Testing Pitfalls and How to Solve Them
summary
Uses Jest for unit tests and Cypress for end-to-end tests on a Shopware app and shows concrete fixes: reset the app in beforeEach reset and create fixture data via API so tests are isolated, replace brittle CSS with data- selectors or cy.contains, avoid fixed sleeps and prefer cy.wait for API or waiting for UI changes, name tests with Roy Osherove’s three-part rule and structure them with Arrange‑Act‑Assert. Claims these changes cut flakiness and speed pipelines; legacy refactors may be needed but they work.
AI-written summary · about
chapters (22)
- 0:00Introduction
- 1:29Testing as a trap analogy
- 3:38Three common testing pain points
- 7:30Golden rule: Keep tests simple
- 10:43Test naming with three-part rule
- 12:28Test structure with AAA pattern
- 14:14Avoid shared test data
- 17:08Meaningful test data naming
- 18:51Avoid implementation details in selectors
- 20:58Replace fixed waits with dynamic waits
- 23:47Refactoring legacy test code
- 24:48Tests as friendly assistants
- 27:09Q&A session begins
- 28:11Flat test design explained
- 30:18Balancing abstractions in tests
- 31:43Most annoying testing trap
- 33:07Overcoming flaky tests
- 35:37Mocking database results debate
- 36:41Choosing test types wisely
- 39:10Preference for unit testing
- 40:34Final tips for faster tests
- 42:00Closing and thank you
