Automated Visual Testing

Has anybody cracked the problem of being able to fail Tests if the screen layout has changed from baselined values?

The scenario is that when a fairly large app is in active development or continuous uplift, squads may regularly change common UI components that are used all over the app. We need a way to baseline what is an acceptable app UI experience (eg screenshots in UITests) and then compare them with those from later runs of the same UITest after making UI changes to see if that has potentially affected areas of app that we did not expect to change , by failing that UITest

Replies

I personas haven’t try screenshot testing. However, I found a open source library in GitHub by pointfree.

it seems you can write your own custom code to grab UI hierarchy and use it as baseline for comparing later.

hope this help

https://github.com/pointfreeco/swift-snapshot-testing