My experience writing automated tests for a SPA

15 points by motet-a


pzel

Fantastic approach. I did something similar at a previous gig. Never cleaning up, being robust to existing server state, and generating fresh data for each specific test case also helped us, as in this case, to massively parallelize our test suite.

Basically, I write tests just like anyone would use the app in production: each test creates its own objects without relying on any existing data, never touches data it did not create, and never cleans up anything. Data just accumulates. This strategy works really well for apps like Réécoute, where nothing is actually public.

This is my love language ;) Also regarding the discussion of fakes: a lot of people complain about singleton fakes, due to the fact that they won't reflect changes in the real behavior of downstream systems (until you, the developer, become aware of them). That, and the concern about run-times (where it seems playwright parallelization helps a lot) are a common push-back that I get when I adopt this testing approach. (I touch on this a bit in the linked blog post).

META: I wrote up a longer comment previously but got stuck on an Anubis page that wouldn't progress (no bar, no nothing). Clicking 'back' took me back to the lobsters main page. Something is busted, it seems.

gavinmorrow

The theme for this website is broken on dark mode. When something is highlighted (like with an anchor link) then the background and text are both white.

Edit: also headings.