You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
failed - Error Error Domain=UISceneErrorDomain Code=101 "The current windowing mode does not allow for programmatic changes to interface orientation." UserInfo={NSLocalizedDescription=The current windowing mode does not allow for programmatic changes to interface orientation.}
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:
jrames
changed the title
failed - Error Error Domain=UISceneErrorDomain Code=101 "The current windowing mode does not allow for programmatic changes to interface orientation." UserInfo={NSLocalizedDescription=The current windowing mode does not allow for programmatic changes to interface orientation.}
interface orientation errors on all local snapshot tests
Aug 16, 2024
Hey @jrames There are a couple things I can think of here. First, are any of your previews directly setting the orientation with previewOrientation(...) If not it would default to portrait and should never attempt to change orientation assuming your simulator is already in portrait. If this is the case, can you try adding a breakpoint in UIKitRenderingStrategy around line 47 and see what the difference is between targetOrientation and windowScene.interfaceOrientation?
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.
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: