Skip to content

Commit

Permalink
feat: look for critical notification in respectSystemAlerts
Browse files Browse the repository at this point in the history
  • Loading branch information
KazuCocoa authored Dec 12, 2024
1 parent deb8eca commit 768553e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions WebDriverAgentLib/Routing/FBSession.m
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,13 @@ - (XCUIApplication *)activeApplication
if (nil != self.testedApplication) {
XCUIApplicationState testedAppState = self.testedApplication.state;
if (testedAppState >= XCUIApplicationStateRunningForeground) {
// We look for `SBTransientOverlayWindow` elements for half modals. See https://github.com/appium/WebDriverAgent/pull/946
NSPredicate *searchPredicate = [NSPredicate predicateWithFormat:@"%K == %@ OR %K == %@",
NSPredicate *searchPredicate = [NSPredicate predicateWithFormat:@"%K == %@ OR %K == %@ OR %K == %@",
@"elementType", @(XCUIElementTypeAlert),
@"identifier", @"SBTransientOverlayWindow"];
// To ook for `SBTransientOverlayWindow` elements. See https://github.com/appium/WebDriverAgent/pull/946
@"identifier", @"SBTransientOverlayWindow",
// To look for 'criticalAlertSetting' elements https://developer.apple.com/documentation/usernotifications/unnotificationsettings/criticalalertsetting
// See https://github.com/appium/appium/issues/20835
@"identifier", @"Notification"];
if ([FBConfiguration shouldRespectSystemAlerts]
&& [[XCUIApplication.fb_systemApplication descendantsMatchingType:XCUIElementTypeAny]
matchingPredicate:searchPredicate].count > 0) {
Expand Down

0 comments on commit 768553e

Please sign in to comment.