stracker-phil/codeceptjs-pixelmatchhelper

[FEATURE] better error handling for getVisualDifference

Closed this issue · 1 comments

Currently getVisualDifference just throws generic errors. Thus, a client cannot implement their own error handling. My suggestion would be to implement specific exceptions in order for them to be handled individually.

This would especially allow to still diff images which have different dimensions (e.g. by all expected images to match the actual image).
Of course an option would need to be introduced to fallback to current behaviour, too.

Motivation:
If due to some change an element gets added to a website, or some elements have different sizes, the dimensions won't be the same, however a diff can help identify the problem easily.

Will come back to this with a PR as soon as time comes by.

As different dimensions can be treated easily my problems vanished; while still helpful, this would increase complexity a lot