I have an iOS app that needs some privileges (GPS, Push notifications). When the application is launched for the first time, iOS asks the user if they support these permissions for the application. I have written several UITests and want to automate their launch on a locally connected iPhone.
The problem is that I cannot override issues with permissions, and my tests failed. I found out that the application deployed by the IDE (Xamarin Studio) will request permissions, but the application deployed through UITests will not. So I tried with .AppBundle(path_to_app) , but it says that this is only valid for deployment in Simulator.
SetUp: System.Exception: This application package is not valid for running the simulator. To resolve this issue, make sure your target device is a simulator. DTPlatformName is "iphoneos" and not "iphonesimulator" in Info.plist applications.
Like an attempt to deploy the iPhone app for Simulator. But Target in Xamarin Studio is configured on a real device. I tried to add .DeviceIdentifier . When used with .InstalledApp it starts (still asking for permission). But when I used DeviceIdentifier and AppBundle , the error described above occurred.
My tests work fine on a test cloud. They work great on Simulator. They work great when I manually deploy the device, run the application and approve permissions, and then run the user interface tests.
What I cannot achieve is to force UITests to redefine rights issues on a real device. Has anyone done this job?
The last thing I found is in the documentation for the AppBundle method "Will make it work on the simulator" https://developer.xamarin.com/api/member/Xamarin.UITest.Configuration.iOSAppConfigurator.AppBundle/p/System.String/
So, I can be doomed to the task, but maybe someone knows a workaround?
Bartosz strutyński
source share