Skip to content

Is there a simple way to programmatically export diff images? #1026

@kanjanaSi

Description

@kanjanaSi

I have a question about handling test failures. When a snapshot test fails, a diff image is generated. Is there a straightforward or built-in way to programmatically save this diff image to a specific, predictable path?

For example, I'd like to be able to automatically export the diff to a path like this upon failure:
…/MyAppTests/Snapshots/MyViewControllerTests/diff_testMyViewController.png

This would be extremely helpful for our CI/CD process, allowing us to easily archive and review the visual differences without having to manually extract them from the test logs or Xcode.

I've looked through the documentation but haven't found a direct way to configure this output path. Is there a recommended approach or a configuration option I might have missed?

Thanks for your time and any guidance you can provide!

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