3 ms·
Ask HN: How should we unit test web UI? Do mocks ever work?
- deleted 6y ago[deleted]
- 2rsf 6y agowhat is the goal of your testing?
- Jugurtha 6y agoWe used Selenium and we were able to catch a lot of regressions in the application. These are not "unit tests". Here's a talk by Brandon Rhodes titled "Using Python to power Selenium at scale": https://www.youtube.com/watch?v=z1aUuqKg_gA https://www.youtube.com/watch?v=z1aUuqKg_gA We'd have a deployment, and then launch a Selenium script to test the UI: login page load, registering a user, creating resources from the application, displaying elements, input text to validate, etc. This is coupled with a lot of input validation, and a lot of actual unit tests for functions. We also decoupled functionality into pure functions.