Skip to content

Display image filename/filepath in exceptions  #106

@sergiu-mezei-aera

Description

@sergiu-mezei-aera

Hi guys,

We're using shutterbug to do multiple image comparisons inside a test method and we're using Allure reports for the reporting part.
I would like to suggest an improvement: displaying the image filename/filepath inside the exceptions thrown rather than just the "image1"/"image2" hardcoded strings or at least any image path information (like the resulting diff image path). This would help us to easily debug and fix tests because we know which images are affected.

For example:
We get an exception like this:
Images dimensions mismatch: image1 - 300x753; image2 - 300x754 com.assertthat.selenium_shutterbug.utils.image.UnableToCompareImagesException: Images dimensions mismatch: image1 - 300x753; image2 - 300x754 at com.assertthat.selenium_shutterbug.utils.image.ImageProcessor.imagesAreEqualsWithDiff(ImageProcessor.java:140) at com.assertthat.selenium_shutterbug.core.Snapshot.equalsWithDiff(Snapshot.java:325) at utils.ImageCompare.compareWebElement(ImageCompare.java:133) at ui_tests.ui_builder_tests.TableComponentTest6.goToNextNodeRowSelectionTrueTest(TableComponentTest6.java:102) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions