google / google/Accessibility-Test-Framework-for-Android

Question about custom AccessibilityHierarchyCheck

Open
#64 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
Java
Stars
520
Forks
154
PR merge metrics
No merged PRs in 30d

Description

Hello!

I'm looking into adding a few custom `AccessibilityHierarchyCheck`s for my project, however I noticed that if I want to do that, I have to provide my own subclass of `AccessibilityHierarchyCheckResult`.
Reason is that `AccessibilityHierarchyCheckResult` has a private method, `getChecks()`, which makes sure the check is one of the presets from `AccessibilityCheckPreset.CLASS_TO_HIERARCHY_CHECK`, by calling `AccessibilityCheckPreset.getHierarchyCheckForClass(...)`.

I'm wondering if it's possible to decouple the two: `AccessibilityHierarchyCheckResult` and `AccessibilityCheckPreset`.

I understand that the current pattern makes it possible to instantiate checks only once, and thus allows access to them through a singleton, which, in turns, uses a variation of the service locator pattern. Is it possible, for example, to add another layer of indirection, for example, a singleton called `AccessibilityChecksAggregator`, which can be configured to take in the preset or a custom set of checks before tests run?

P.S.: I'm not adding a Contributor License Agreement since I'm not contributing with any code or any tangible value, at least not yet.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.