The whole UI seems better for LLMs to consume and also displays nicely in-editor for humans. Test failures become failing screenshot tests essentially, which are really comfortable changes to review.
Yaml is just a serialization of some intermediate representation. The expect test output in the article is a full-fidelity (minus color) rendering of the UI. I would argue that the final app UI is both easier to read for humans and covers more code. As an example, a naive yaml test would likely not capture positions of all of the elements in the app and so you’d be able to silently introduce positioning bugs. On the flip side, if the yaml does include positioning information then it’s now substantially harder to read than the UI test and the signal from the test is compromised because readers will have a harder time understanding and be more likely to ignore.