Skip to content
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

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

Open
mel-leo-liu opened this issue Jul 10, 2020 · 3 comments

Comments

@mel-leo-liu
Copy link

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
Copy link
Contributor

jmoody commented Jul 10, 2020

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
Copy link
Author

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
Copy link
Contributor

jmoody commented Jul 14, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants