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

feat: look for critical notification in respectSystemAlerts #962

Merged
merged 4 commits into from
Dec 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions WebDriverAgentLib/Routing/FBSession.m
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,13 @@ - (XCUIApplication *)activeApplication
if (nil != self.testedApplication) {
XCUIApplicationState testedAppState = self.testedApplication.state;
if (testedAppState >= XCUIApplicationStateRunningForeground) {
NSPredicate *searchPredicate = [NSPredicate predicateWithFormat:@"%K == %@ OR %K == %@ OR %K == %@",
NSPredicate *searchPredicate = [NSPredicate predicateWithFormat:@"%K == %@ OR identifier IN {%@, %@}",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is still ok to use %K for identifier

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@"elementType", @(XCUIElementTypeAlert),
// To ook for `SBTransientOverlayWindow` elements. See https://github.com/appium/WebDriverAgent/pull/946
@"identifier", @"SBTransientOverlayWindow",
// To look for `SBTransientOverlayWindow` elements. See https://github.com/appium/WebDriverAgent/pull/946
@"SBTransientOverlayWindow",
// To look for 'criticalAlertSetting' elements https://developer.apple.com/documentation/usernotifications/unnotificationsettings/criticalalertsetting
// See https://github.com/appium/appium/issues/20835
@"identifier", @"Notification"];
@"Notification"];
if ([FBConfiguration shouldRespectSystemAlerts]
&& [[XCUIApplication.fb_systemApplication descendantsMatchingType:XCUIElementTypeAny]
matchingPredicate:searchPredicate].count > 0) {
Expand Down
Loading