Replies: 3 comments
-
in my case I have been able to solve it: func testMyViewController() {
let vc = UIViewController()
let window = UIWindow()
window.rootViewController = vc
window.isHidden = false
let container = UIViewController()
container.view = window
assertSnapshot(matching: container, as: .image)
} |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Hi @tahirmt, windows are treated specially in UIKit and I'm not sure we can come up with a full-proof way to screenshot them. At the very least you should probably invoke Since I'm not sure this is really an issue with the library I am going to convert it to a discussion. Please feel free to continue the conversation over there! |
Beta Was this translation helpful? Give feedback.
-
Describe the bug
If I try to run a snapshot test for a view controller but by adding it into a window myself, it causes a crash
To Reproduce
Expected behavior
The window should be recorded as any other view does
Environment
Additional context
This is the console messages
Beta Was this translation helpful? Give feedback.
All reactions