calabash / run_loop

The bridge between Calabash iOS and Xcode command-line tools like instruments and simctl.
Other
32 stars 41 forks source link

DeviceAgent does not dismiss APNS springboard alert automatically in Simplified and Traditional Chinese when running on physical devices #753

Open mel-leo-liu opened 4 years ago

mel-leo-liu commented 4 years ago

I know that DeviceAgent is not open source yet but is there a way for me to quickly add the Simplified and Traditional Sprintboard alert definitions into here: https://github.com/calabash/DeviceAgent.iOS/blob/b6ac427308ed5b4a58ddc7011d04ccc13754f707/Server/Utilities/SpringBoardAlerts.m#L107

It is currently preventing us from running our automation against an iOS device with its language being set to Simplified Chinese and Traditional Chinse...so it is urgent for us....hopefully can hear back from you soon

jmoody commented 4 years ago

DeviceAgent is open source.

The link you sent is a very old version of DeviceAgent.

The alert definitions are here:

https://github.com/calabash/DeviceAgent.iOS/tree/develop/Server/Resources.xcassets/springboard-alerts

You can make a new file with definitions or append an existing one.

ATTN @ivan-nosar

mel-leo-liu commented 4 years ago

Thanks for your promptly response Jmoody...I can clearly see the zh_TW (Traditional Chinese) and zh_CN (Simplified Chinese) alerts files and the alert definitions we need in those files, e.g: Bluetooth permission... { "title": "“%@”想要使用蓝牙", "buttons": [ "好" ], "shouldAccept": true }

Not sure why DeviceAgent/Xamarin.UITest is not dismissing the springboard alert still? I am using Xamarin.UITest 3.0.7...Can you think of anything where this issue could occur?

jmoody commented 4 years ago

Bluetooth Alerts are difficult to test. We cannot reliably generate them and the text on devices and simulators is often different which makes matching difficult.

You will probably need to manage these alerts manually.

You are using Xamarin.UITest? If so, you will need to make a few HTTP requests to the DeviceAgent. I don't think Xamarin.UITest has an API for this - maybe it does.

  1. Turn off automatic dismissal of SpringBoard alerts - otherwise, you will see an exception
  2. Trigger the alert
  3. Handle the alert by touching the correct button
  4. Optionally turn on automatic dismissal of SpringBoard alerts

Example client code is here:

Here is the server code:

Next time open an issue on the DeviceAgent repo.