4 ms·
If you mock out one end of the test, can it really be considered end-to-end anymore? Isn't it just UI testing now ?
by dikei 3y ago
If you mock out one end of the test, can it really be considered end-to-end anymore? Isn't it just UI testing now ?
- easton 3y agoWe had this discussion at work too, and decided it was worth keeping our e2e tests e2e (no mocking, pointing the UI code at our integration environment). However, I think there's value in also having a set of tests that do mock the dependencies while testing UI flows because of how long it takes to run the real e2e tests. so "both" is the dream, with e2e tests being more critical.
- tough 3y agocan't you have both and just run the mocks if not specified else like in a ci or whatever
- RicDan 3y agoYes you can. Our tests are layered as follows: - unit tests - mocking tests - integration tests (i.e. service + db) - system tests (full api to db level) integration starts providing flaky tests already sadly, i.e. with kafka on our end… (i.e. calling the listener twice or thrice even tho it should only once..)
- onion2k 3y agoIt's hard to name them I suppose. They're more than just UI tests because there's usually a decent amount of logic in the frontend apps I build (significantly more than just driving the UI), so I call them end-to-end or integration tests.
- hitchstory 3y agoIt's a hermetic end to end test. The ideal is to mock out the API with some sort of recording mode to autoupdate the mock.
- beezlewax 3y agoDo you have any example of this you can share? Keeping mocks up to date can be hell
- dvngnt_ 3y agodo both!