Open FkMarcus opened 1 year ago
Same thing happens for me, I've got approx 1k test cases in the project, and some of them (very few 10-20) fails. I've tried several different approaches: comparing UIViewControllers with ViewImageConfig, comparing UIViews with custom size set and even writing custom snapshotting strategy. All of them somehow get down to the minimal size (width = 320, height = 480) I finished with commenting out the failing tests 😔
I'm trying to use this framework for snapshot testing from some view controllers. It works fine in most cases, but I have one big issue. for example here is my test
So, I'm trying to run a test on an iPhone 13. In the view controller, I use
UIScreen.main.bounds
to calculate some sizes, and it works fine when the test is not running. However, in the snapshot test, the value ofUIScreen.main.bounds
is different, causing issues.Here is
UIScreen.main.bounds
when I run app on simulation (not testing)but in UI testing
Am I doing something wrong here? Or it is a bug? Thanks you for your response in advance
Environment
swift-snapshot-testing version 1.10.0 Xcode 14.2 Swift 5.7.2 OS: 16.2