-
Notifications
You must be signed in to change notification settings - Fork 913
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
Cannot click on system alerts in Xcode 12 #1156
Comments
Hi @dostrander! Did you have a chance to look into this issue? I had a quick look at it yesterday, but the only other way I know of to access alerts is through |
@pquillere I have not unfortunately. Hopefully going to have time in the coming weeks. Might have to think of another way to go about this. If we can't find a way we may have to deprecate clicking on system alerts and resort to exposing a suppression of the system alerts rather than a mechanism to click on them. Open to suggestions on this! |
KIF uses the unit test framework by design.
As long as I’ve used KIF we have not ever been able to interact with system prompts.
If the UI test framework can, then I wonder if we can utilize the API there without compromising KIF?
…Sent from my iPhone
On Sep 15, 2020, at 1:59 PM, Pierre-Jean Quilleré ***@***.***> wrote:
Hi @dostrander! Did you have a chance to look into this issue?
I had a quick look at it yesterday, but the only other way I know of to access alerts is through XCUIApplication which is only available in a UI Test Target. But KIF is using a Unit Test Target to drive the UI.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
@mikelupo We've been able to use it for the push notification authorization alert. That would only work on a simulator though. What work around have you been using to interact with system alerts during UI testing? @dostrander How would the "suppression of the system alerts" work? |
Yes, a simulator does not have system UI barriers like an actual device does. Sorry I was not specific about that. I have always tested on a farm of real hardware. Never tested on simulators as the desktop on corporate machines, even in our labs, are required to be locked out.
…Sent from my iPhone
On Sep 15, 2020, at 5:02 PM, Pierre-Jean Quilleré ***@***.***> wrote:
@mikelupo We've been able to use it for the push notification authorization alert. That would only work on a simulator though. What work around have you been using to interact with system alerts during UI testing?
@dostrander How would the "suppression of the system alerts" work?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
@pquillere To possibly swizzle the asking of permissions of system alerts to automatically give the permission. Need to look into it more |
Running
as
Because class UIATarget doesn't exists as UIAutomation framework not available on iOS 14 From what I looked at, after viewing APIs offered for UI Tests (https://developer.apple.com/documentation/xctest/xctestcase/handling_ui_interruptions)
is coded in XCTest framework, so I tried to use it:
But the handler never gets executed As it works on |
Any news or ideas on how to solve this issue? |
I have used https://github.com/wix/AppleSimulatorUtils in Test Pre-Action as WorkAround |
Any news on this issue ? Until now I was using XCUI to dismiss the system alerts, But I started running the tests on firebase testlab and the app gets stuck on the alert sometimes. |
AFAIK firebase uses real devices which you may be hitting this: #1156 (comment) However, i have not been able to look into this issue yet. It is likely going to require some reverse engineering into what XCUI does to dismiss alerts |
Thank you @dostrander . Looking forward to this. Currently we are running KIF on firebase using flank. Also, Im curious how others run KIF tests.
It would be super useful for us to learn about what others follow because the only issue with running them on firebase is that its run on real device and we can't close the alerts. |
@sai-kishore-swaminathan I'm moving my tests over to the same setup (KIF on firebase with Flank). Also being hit by failures with permissions alerts. Were you able to resolve this? |
Hey @evandorn essentially no we can't do this from KIF right this second. However if we can resolve #1267 and #1266 we should be also able to get this to work again. These dialogs (along with the other issues) are out of process and since we are an in process test we can't access them currently. We need to do some reverse engineering on how XCUI works and see if we can mimic that behavior using private APIs. Once we do that I think we will be able to resolve these types of issues 🤞 |
In Xcode12 it seems that UIAutomation has been removed which is the mechanism we use to click on system alerts.
We need to look into another mechanism to click on system alerts in Xcode12.
The text was updated successfully, but these errors were encountered: