Skip to content

Conversation

@d4rken
Copy link
Member

@d4rken d4rken commented Aug 15, 2025

Fixes #1885

d4rken added 4 commits August 15, 2025 20:16
Fixes #1885

Also introduce ACSNodeInfo interface for accessibility nodes

This commit introduces an `ACSNodeInfo` interface to abstract `AccessibilityNodeInfo`. This change improves testability by allowing mock implementations and prepares for potential future support of other accessibility frameworks.

All usages of `AccessibilityNodeInfo` have been updated to use `ACSNodeInfo`. Basic tests for new `findClickableSibling` and `findClickableParent` methods are also added.
This commit introduces unit tests for the `clickNormal` extension function in `StepperExtensions.kt`. It also modifies `TestACSNodeInfo.kt` to track performed actions, enabling more robust testing of action-related logic.
This commit introduces a comprehensive test suite for the `AccessibilityNodeExtensions.kt` file. It covers various extension functions for `ACSNodeInfo` and `AccessibilityEvent`.

Key areas tested:
- Text matching (`textVariants`, `textMatchesAny`, `textContainsAny`, `textEndsWithAny`)
- ID matching (`idMatches`, `idContains`)
- Node type checks (`isClickyButton`, `isTextView`, `isRadioButton`)
- Node traversal and hierarchy (`children`, `findParentOrNull`, `getRoot`, `crawl`)
- Node actions (`scrollNode`)
- `AccessibilityEvent.pkgId` extension

The tests utilize a mock `TestACSNodeInfo` class (which was also slightly modified to be an open class and override equals/hashCode for better testability) to simulate different node states and properties.
@d4rken d4rken added enhancement New feature, request, improvement or optimization c: AppCleaner Automation Accessibility service related (ACS) ROM: AOSP AOSP or close to AOSP. labels Aug 15, 2025
@d4rken d4rken merged commit 148ccaa into main Aug 15, 2025
16 checks passed
@d4rken d4rken deleted the acs-sibling-matching branch August 15, 2025 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Automation Accessibility service related (ACS) c: AppCleaner enhancement New feature, request, improvement or optimization ROM: AOSP AOSP or close to AOSP.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

App Cleaner stops at 25% approximately

2 participants