Option to ignore part of snapshot when comparing #1047
Replies: 2 comments 4 replies
-
|
just as a suggestion, you can try to see if you can pass the time value from outside the view as a parameter, then you have a static time for snapshotting purposes. |
Beta Was this translation helpful? Give feedback.
-
Yeah, we personally would recommend controlling your dependency on time via either a clock, combine scheduler, and some other means. That would even allow you to snapshot your view deterministically at a specific time, which could be handy if there are things in the UI that change with respect to the timer. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
We here at LEGO are happy users of the swift-snapshot.testing framework.
Thank you for supporting this.
Is it possible ignore areas or parts of a snapshot in the case that we expect there to be differences.
Use case:
We use snapshotting as image to monitor UI changes. In a view we have counters that count down, which means that the text in the view is changing. Locally this is not a problem because the test runs within the same second but in XCodeCloud sometimes the test takes longer and therefore the text has changes, which causes the tes to fail - obviously.
Is it possible to ignore either a defined area of the image or a certain view i.e. by name?
Are there other ways to handle this case - I assume the same will be a problem with i.e. a clock?
Beta Was this translation helpful? Give feedback.
All reactions