This is the payoff of everything so far. A UI test usually cares about one
behavior — does this article render? — but reaching that state through the UI means
logging in, opening the editor, filling four fields, and publishing, every single
time. That's slow and, worse, it makes the test fail for reasons unrelated to what
it's checking.
The integration pattern fixes it: do setup through the API, verify through the
UI. We already have the pieces — makeArticle (Chapter 14) creates data in
milliseconds; now we just point the browser at it.
Code for this chapter is tagged
ch-16in the repo:
and tell me how much of your UI setup you've moved to the API.
SOCIAL SHARE CARD GENERATOR