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

Conversation

KazuCocoa
Copy link
Member

@KazuCocoa KazuCocoa commented Dec 12, 2024

For appium/appium#20835

Critical notification is by the springboard:

    <XCUIElementTypeWindow type="XCUIElementTypeWindow" enabled="true" visible="true" accessible="false" x="0" y="0" width="375" height="667" index="10">
      <XCUIElementTypeOther type="XCUIElementTypeOther" enabled="true" visible="true" accessible="false" x="0" y="0" width="375" height="667" index="0">
        <XCUIElementTypeOther type="XCUIElementTypeOther" enabled="true" visible="true" accessible="false" x="8" y="8" width="359" height="77" index="0">
          <XCUIElementTypeOther type="XCUIElementTypeOther" name="Notification" label="Notification" enabled="true" visible="true" accessible="false" x="8" y="8" width="359" height="77" index="0">
            <XCUIElementTypeOther type="XCUIElementTypeOther" enabled="true" visible="true" accessible="false" x="8" y="8" width="359" height="77" index="0">
              <XCUIElementTypeOther type="XCUIElementTypeOther" name="NotificationShortLookView" label="OWLET DREAM, 7 minutes ago, Owlet Dream, LOW PULSE RATE: Check on the Baby.,  CRITICAL" enabled="true" visible="true" accessible="true" x="8" y="8" width="359" height="77" index="0"/>
            </XCUIElementTypeOther>
          </XCUIElementTypeOther>
        </XCUIElementTypeOther>
      </XCUIElementTypeOther>
    </XCUIElementTypeWindow>

I'll try to test this out later.

@@ -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.

@KazuCocoa KazuCocoa merged commit 916c8c5 into master Dec 13, 2024
45 of 46 checks passed
@KazuCocoa KazuCocoa deleted the respect-critical-alert branch December 13, 2024 19:03
github-actions bot pushed a commit that referenced this pull request Dec 13, 2024
## [8.12.0](v8.11.3...v8.12.0) (2024-12-13)

### Features

* look for critical notification in respectSystemAlerts ([#962](#962)) ([916c8c5](916c8c5))
Copy link

🎉 This PR is included in version 8.12.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants