-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
interface orientation errors on all local snapshot tests #161
Comments
Hey @jrames There are a couple things I can think of here. First, are any of your previews directly setting the orientation with Also, are you running on an iPad? If so the app needs to have "UIRequiresFullScreen" set to true in Info.plist in order to programmatically rotate. If you run it on an iPhone it shouldn't have this issue. Also can you check if you are overriding this method? https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1623107-application |
I'm having the same problem. I don't have any preview interface orientation modifiers on the previews, I even tried adding one but it's the same. Based on my initial investigation, it looks like snapshot previews assumes tests will run with a host app in place. I'm currently trying this in a Swift package where my product is a Swift library. I'm actively looking for ways to get this to work but I'd love if this is something known and if there's a way forward. |
Apologies for the delay! We did get this resolved, though to be honest I don't recall the root cause exactly. I believe in the initial attempt, I was attempting this with an SPM package test target. In the current implementation, I have it pointing to an Xcode test target created for snapshot tests. That seems to work, and I didn't have to change anything else to resolve the orientation error. |
I'm testing out Local Snapshot Generation. I was able to get it working in a simple repo, but in my primary application all of the generated tests fail with the following:
I tried drastically simplifying things by returning a single very simple Preview via
snapshotPreviews()
and still hit this. It must be related to my project config in some way but I'm not sure. I'm also running on a sim and have tried a few different ones. Any ideas / suggestions would be appreciated.The text was updated successfully, but these errors were encountered: