DOM/Structural Testing

In DOM testing, the application under test is verified by comparing the DOM or structure of the graphical user interface with some criteria.

Some example criteria include checking whether an element has a specific class or id (or in general matches some CSS selector), or which element comes before or after another. It’s also common to check whether an element exists in the DOM at all.

It cannot verify the actual looks of the graphical interface, however it can be much faster than screenshot testing.

Using snapshot testing, DOM testing can usually be made much much easier, but the tests tend to be harder to maintain because they test so much more than you would usually test.

1 Backlinks   backlinks