- Is it possible to unit test that something is visually rendered as wanted (for some definition of wanted)? Specifically for HTML and CSS renders your page as "expected"
I would personally imagine such tools allow you to define a test in a declarative manner of how something is supposed to look and then run a complex heuristic on the actual file your testing that determines how "close" it is to your declarative definition.
- Would there be any other ways to do machine testing on, say a HTML file for whether the content is visually consistent.
I'm not asking to almost impossible question of whether something "looks good", but rather whether it looks consistent or whether it matches a given pattern.
- The final question is, if these tools don't exist, are they worth writing? Would tools of such a nature actually give you meaningful results that are not bound by a very large margin of error. I.e. could they accurately predict whether some change to code has broken your visual layout without giving a large amount of false negatives or missing things that are obviously broken.