3 ms·
Is there any reason why you couldn't do this non-visually? That is, using PhantomJS to determine that a DOM element is within certain bounds for a position usin
by danso 13y ago
Is there any reason why you couldn't do this non-visually? That is, using PhantomJS to determine that a DOM element is within certain bounds for a position using if statements?
- scott_karana 13y agoThat probably would be a better approach, you're right. They could even still render the DOM-based diffs. They even mention anti-aliasing rendering issues, and applying of a 20% fuzz factor to work around it...
- teej 13y agoThere's a few reasons: Simplicity. This automatically tests the whole page "for free". Robustness of feedback for time spent. A small visual change could cascade into lots of tests cases that must be updated (rendering is hard, look how long it took IE to get it right). You don't need to update any tests with this tool, you just give the OK to a visual diff with expected changes. Dynamic content. The BBC homepage is going to be different every day. Writing tests to test this could be arduous and error prone. Testing production content on build 779 vs 780 is a simple way to test regressions.
- IanCal 13y agoMore importantly, you don't need someone technical to tell if it's an important change. This can easily be signed off by QA, designers, PMs, etc. They can see what it was before, after and what changed and decide if that's OK. Also, the difference between a wanted visual change and a break is dependent on the change you want. That makes this quite a flexible tool (it's not just "any difference is wrong") that can be used simply and is unlikely to have false negatives (while making it easy to ignore false positives).
- fohara 13y agoAutomated layout analysis is pretty tricky. The data reported from the DOM is not always reliable, so it's helpful to couple it with computer vision data. I spoke about an integrated approach at Selenium Conf 2013: http://www.youtube.com/watch?v=DF0QUD0kuiQ http://www.youtube.com/watch?v=DF0QUD0kuiQ
- IanCal 13y agoThey don't care about that. They don't care if it's within 10px of the right location, or whether it's one DOM element or multiple, or how it's structured. They care it looks right, and that certain things look identical between builds. The size and position of the BBC logo, for example, must be in exactly the same position. Also, this means it can be verified by a non-technical person. All you need to do is verify that the differences are either 1) wanted or 2) irrelevant, and this is an extremely simple and robust way of achieving that.