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
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",
KazuCocoa marked this conversation as resolved.
Show resolved Hide resolved
// 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
Loading