-
Notifications
You must be signed in to change notification settings - Fork 390
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
feat: Add a setting to respect system alerts while detecting active apps #907
Conversation
@@ -34,3 +34,4 @@ | |||
NSString* const FB_SETTING_WAIT_FOR_IDLE_TIMEOUT = @"waitForIdleTimeout"; | |||
NSString* const FB_SETTING_ANIMATION_COOL_OFF_TIMEOUT = @"animationCoolOffTimeout"; | |||
NSString* const FB_SETTING_MAX_TYPING_FREQUENCY = @"maxTypingFrequency"; | |||
NSString* const FB_SETTING_RESPECT_SYSTEM_ALERTS = @"respectSystemAlerts"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was not quite sure about the setting name. Maybe you'd have better proposals
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the change itself lg, let me think of the naming
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. "system alert" naming is reasonable to imagine this setting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this. From what I can tell this only handles XCUIElementTypeAlert
elements, which should cover most cases, but I vaguely recall (from my own projects) that there may be some other element types as well (e.g. picker wheels or file sharing modals). I will check this on Monday/Tuesday, but those can also be handled in a separate PR if necessary.
I don't remember any cases where springboard shows something different from an alert. Please provide examples of the system app page source for such cases. |
I will check my project on Monday/Tuesday, but I don't think it should block this PR. |
## [8.7.0](v8.6.0...v8.7.0) (2024-06-01) ### Features * Add a setting to respect system alerts while detecting active apps ([#907](#907)) ([5c82d66](5c82d66))
🎉 This PR is included in version 8.7.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Okay, I have checked a bit and found 2 cases where springboard places something other than an alert over the app:
I will have more time to investigate the XMLs tomorrow. |
@mykola-mokhnach here is a gist with XMLs for the two TestFlight screens mentioned above (edited for privacy): https://gist.github.com/eglitise/4704401148fef1db400e8e6be782973b |
Currently we detect the app under test as active if XCTest returns RunningInForeground state for it. In case the app is covered by a system alert from springboard this might be confusing as we cannot interact with it unless an alert is properly handled. The new setting called
respectSystemAlerts
being set totrue
(by default it isfalse
) forces WDA to verify the presence of alerts shown by springboard and return the latter if an alert is shown. This affects the performance of active app detection, but might be more convenient for writing test script (e.g. eliminates the need of proactive switching between system and custom apps).