Status Update
Comments
ma...@google.com <ma...@google.com> #2
I believe our semantics testing system already supports (tests) accessibility by default.
Over to Jelle to give more context and see if there's a feature opportunity for us
je...@google.com <je...@google.com> #3
The kind of tests done by AccessibilityChecks.enable()
are designed for a View hierarchy and are likely to result in false positives or false negatives.
We will probably need to add a Compose aware variant of those checks.
sa...@fmr.com <sa...@fmr.com> #4
ok Sure Jelle I will wait for this implementation
Thank you for your reply
ae...@google.com <ae...@google.com> #5
Note that Compose already works with Accessibility Scanner which has a similar set of checks, although that's a manual process. There's still a need for an automated equivalent to catch regressions.
I found a complete list of the checks Espresso does
TouchTargetSizeViewCheck
Target height or target width less than 48 dp is flagged, unless there is a touchdelegate detected.
TextContrastViewCheck
Checks text color and background and factors in large text, and calculates the contrast ratio: - 4.5 for regular text, 3 for large text.
DuplicateSpeakableTextViewHierarchyCheck
If two Views in a hierarchy have the same speakable text, that could be confusing for users if at least one of them is clickable.
SpeakableTextPresentViewCheck
If the view is focusable, this checks whether valid speakable text exists, and errors if the view is missing speakable text needed for a screen reader.
EditableContentDescViewCheck
Throws an error if Editable TextView has a contentDescription.
ClickableSpanViewCheck
Checks if ClickableSpan is inaccessible. Individual spans cannot be selected independently in a single TextView, and accessibility services are unable to call ClickableSpan#onClick.
RedundantContentDescViewCheck
Accessibility services are aware of the view's type and can use that information as needed. For example, it throws a warning if the content description has a redundant word, such as “button.”
DuplicateClickableBoundsViewCheck
Throws an error if Clickable view has the same bounds as another clickable view (likely a descendent). Sometimes there are containers marked clickable, and they don't process any click events.
si...@gmail.com <si...@gmail.com> #7
Hi
Good to know you are looking into this - to implement something similar as we have with Espresso. :)
I know it's possible to do some accessibility checks by using Semantics with Jetpack Compose. However, I couldn't cover all the cases since SemanticsNodes doesn't provide colors or other extra properties we might have for components or custom components.
For instance, I'm doing some workarounds to validate my components with Snapshots and some hacks to keep consistent across different APIs (Android has some gradient shadow from the top bar for different API levels - with different gray).
I have a thread on kotlinlang Slack with some challenges I've faced implementing tests and accessibility tests with Compose so far.
sa...@fmr.com <sa...@fmr.com> #8
Thanks @AE - Took time for me but finally i tried with Accessibility Scanner App and it was pretty cool with nice reporting but as you said it's manual Trying to find the way to export the report in one single file instead of one file per screen
si...@gmail.com <si...@gmail.com> #9
I noticed Google Scanner doesn't catch content description missing for IconButton.
sa...@fmr.com <sa...@fmr.com> #10
I cross verified , you are right it doesn't capture, Seems its capture only the missing label which i believe comes from default label from Compose function
vi...@gmail.com <vi...@gmail.com> #11
Are there an updates on this? I think being able to maintain tooling parity between both the UI toolkits is critical for most infra teams that work on large apps (Airbnb in my case). We rely on AccessibilityChecks.enable to get some automated testing and wondering when we could expect the equivalent to be available on Compose.
jo...@google.com <jo...@google.com> #12
vi...@gmail.com <vi...@gmail.com> #13
Thanks for the update! I'm definitely tracking this ticket and hope that we can get an update soon so that developers aren't merging components that aren't accessible.
cm...@squareup.com <cm...@squareup.com> #14
Are Accessibility Checks for Compose UI still something that is planned to be prioritized?
ca...@google.com <ca...@google.com> #15
Yes, this is definitely still in the works.
Thanks for pointing out that it's no longer on
cm...@squareup.com <cm...@squareup.com> #16
ca...@google.com <ca...@google.com> #17
It's difficult to provide an ETA, but we're hoping to have more info to share on our current progress around May.
cm...@squareup.com <cm...@squareup.com> #18
br...@google.com <br...@google.com> #19
vi...@gmail.com <vi...@gmail.com> #20
It's 2024. I'm really keen on getting an update. Google has always reiterated the importance of accessibility. I hope that there has been progress on this front and I'm curious to hear more 🙏🏻
sa...@fmr.com <sa...@fmr.com> #21
Thanks for activating this thread, me too actively looking update in this space
je...@google.com <je...@google.com>
ap...@google.com <ap...@google.com> #22
Branch: androidx-main
commit 3bb376ababb0ba08bbcd99f05390ea4e34ed0d9d
Author: Jelle Fresen <jellefresen@google.com>
Date: Tue Apr 02 17:43:09 2024
Add ATF 4.1.1
importMaven.sh com.google.android.apps.common.testing.accessibility.framework:accessibility-test-framework:4.1.1
Bug: 198122348
Bug: 296400284
Test: N/A
Change-Id: I4946c6340abc7a4c9fd724102fc6f9976cd37a1b
A androidx/test/espresso/espresso-core/3.4.0/espresso-core-3.4.0-sources.jar
A androidx/test/espresso/espresso-core/3.4.0/espresso-core-3.4.0-sources.jar.md5
A androidx/test/espresso/espresso-core/3.4.0/espresso-core-3.4.0-sources.jar.sha1
A androidx/test/espresso/espresso-core/3.4.0/espresso-core-3.4.0.aar
A androidx/test/espresso/espresso-core/3.4.0/espresso-core-3.4.0.aar.md5
A androidx/test/espresso/espresso-core/3.4.0/espresso-core-3.4.0.aar.sha1
A androidx/test/espresso/espresso-core/3.4.0/espresso-core-3.4.0.pom
A androidx/test/espresso/espresso-core/3.4.0/espresso-core-3.4.0.pom.md5
A androidx/test/espresso/espresso-core/3.4.0/espresso-core-3.4.0.pom.sha1
A androidx/test/services/storage/1.4.1/storage-1.4.1-sources.jar
A androidx/test/services/storage/1.4.1/storage-1.4.1-sources.jar.md5
A androidx/test/services/storage/1.4.1/storage-1.4.1-sources.jar.sha1
A androidx/test/services/storage/1.4.1/storage-1.4.1.aar
A androidx/test/services/storage/1.4.1/storage-1.4.1.aar.md5
A androidx/test/services/storage/1.4.1/storage-1.4.1.aar.sha1
A androidx/test/services/storage/1.4.1/storage-1.4.1.pom
A androidx/test/services/storage/1.4.1/storage-1.4.1.pom.md5
A androidx/test/services/storage/1.4.1/storage-1.4.1.pom.sha1
ap...@google.com <ap...@google.com> #23
Branch: androidx-main
commit 0d7c590f603dc5a46290f140044ff3ff777638ee
Author: Jelle Fresen <jellefresen@google.com>
Date: Tue Apr 02 17:43:38 2024
Add ATF 4.1.1
importMaven.sh com.google.android.apps.common.testing.accessibility.framework:accessibility-test-framework:4.1.1
Bug: 198122348
Bug: 296400284
Test: N/A
Change-Id: I6e32580e77aa33899e8923fd285fe0e367b237bb
A com/google/android/apps/common/testing/accessibility/framework/accessibility-test-framework/4.1.1/LICENSE
A com/google/android/apps/common/testing/accessibility/framework/accessibility-test-framework/4.1.1/accessibility-test-framework-4.1.1.aar
A com/google/android/apps/common/testing/accessibility/framework/accessibility-test-framework/4.1.1/accessibility-test-framework-4.1.1.aar.md5
A com/google/android/apps/common/testing/accessibility/framework/accessibility-test-framework/4.1.1/accessibility-test-framework-4.1.1.aar.sha1
A com/google/android/apps/common/testing/accessibility/framework/accessibility-test-framework/4.1.1/accessibility-test-framework-4.1.1.pom
A com/google/android/apps/common/testing/accessibility/framework/accessibility-test-framework/4.1.1/accessibility-test-framework-4.1.1.pom.md5
A com/google/android/apps/common/testing/accessibility/framework/accessibility-test-framework/4.1.1/accessibility-test-framework-4.1.1.pom.sha1
A com/google/protobuf/protobuf-bom/3.19.1/LICENSE
A com/google/protobuf/protobuf-bom/3.19.1/protobuf-bom-3.19.1.pom
A com/google/protobuf/protobuf-bom/3.19.1/protobuf-bom-3.19.1.pom.asc
A com/google/protobuf/protobuf-bom/3.19.1/protobuf-bom-3.19.1.pom.asc.md5
A com/google/protobuf/protobuf-bom/3.19.1/protobuf-bom-3.19.1.pom.asc.sha1
A com/google/protobuf/protobuf-bom/3.19.1/protobuf-bom-3.19.1.pom.md5
A com/google/protobuf/protobuf-bom/3.19.1/protobuf-bom-3.19.1.pom.sha1
A com/google/protobuf/protobuf-javalite/3.19.1/protobuf-javalite-3.19.1-sources.jar
A com/google/protobuf/protobuf-javalite/3.19.1/protobuf-javalite-3.19.1-sources.jar.asc
A com/google/protobuf/protobuf-javalite/3.19.1/protobuf-javalite-3.19.1-sources.jar.asc.md5
A com/google/protobuf/protobuf-javalite/3.19.1/protobuf-javalite-3.19.1-sources.jar.asc.sha1
A com/google/protobuf/protobuf-javalite/3.19.1/protobuf-javalite-3.19.1-sources.jar.md5
A com/google/protobuf/protobuf-javalite/3.19.1/protobuf-javalite-3.19.1-sources.jar.sha1
A com/google/protobuf/protobuf-javalite/3.19.1/protobuf-javalite-3.19.1.jar
A com/google/protobuf/protobuf-javalite/3.19.1/protobuf-javalite-3.19.1.jar.asc
A com/google/protobuf/protobuf-javalite/3.19.1/protobuf-javalite-3.19.1.jar.asc.md5
A com/google/protobuf/protobuf-javalite/3.19.1/protobuf-javalite-3.19.1.jar.asc.sha1
A com/google/protobuf/protobuf-javalite/3.19.1/protobuf-javalite-3.19.1.jar.md5
A com/google/protobuf/protobuf-javalite/3.19.1/protobuf-javalite-3.19.1.jar.sha1
A com/google/protobuf/protobuf-javalite/3.19.1/protobuf-javalite-3.19.1.pom
A com/google/protobuf/protobuf-javalite/3.19.1/protobuf-javalite-3.19.1.pom.asc
A com/google/protobuf/protobuf-javalite/3.19.1/protobuf-javalite-3.19.1.pom.asc.md5
A com/google/protobuf/protobuf-javalite/3.19.1/protobuf-javalite-3.19.1.pom.asc.sha1
A com/google/protobuf/protobuf-javalite/3.19.1/protobuf-javalite-3.19.1.pom.md5
A com/google/protobuf/protobuf-javalite/3.19.1/protobuf-javalite-3.19.1.pom.sha1
A com/google/protobuf/protobuf-parent/3.19.1/LICENSE
A com/google/protobuf/protobuf-parent/3.19.1/protobuf-parent-3.19.1.pom
A com/google/protobuf/protobuf-parent/3.19.1/protobuf-parent-3.19.1.pom.asc
A com/google/protobuf/protobuf-parent/3.19.1/protobuf-parent-3.19.1.pom.asc.md5
A com/google/protobuf/protobuf-parent/3.19.1/protobuf-parent-3.19.1.pom.asc.sha1
A com/google/protobuf/protobuf-parent/3.19.1/protobuf-parent-3.19.1.pom.md5
A com/google/protobuf/protobuf-parent/3.19.1/protobuf-parent-3.19.1.pom.sha1
A org/checkerframework/checker-qual/3.22.1/LICENSE
A org/checkerframework/checker-qual/3.22.1/checker-qual-3.22.1-sources.jar
A org/checkerframework/checker-qual/3.22.1/checker-qual-3.22.1-sources.jar.asc
A org/checkerframework/checker-qual/3.22.1/checker-qual-3.22.1-sources.jar.asc.md5
A org/checkerframework/checker-qual/3.22.1/checker-qual-3.22.1-sources.jar.asc.sha1
A org/checkerframework/checker-qual/3.22.1/checker-qual-3.22.1-sources.jar.md5
A org/checkerframework/checker-qual/3.22.1/checker-qual-3.22.1-sources.jar.sha1
A org/checkerframework/checker-qual/3.22.1/checker-qual-3.22.1.jar
A org/checkerframework/checker-qual/3.22.1/checker-qual-3.22.1.jar.asc
A org/checkerframework/checker-qual/3.22.1/checker-qual-3.22.1.jar.asc.md5
A org/checkerframework/checker-qual/3.22.1/checker-qual-3.22.1.jar.asc.sha1
A org/checkerframework/checker-qual/3.22.1/checker-qual-3.22.1.jar.md5
A org/checkerframework/checker-qual/3.22.1/checker-qual-3.22.1.jar.sha1
A org/checkerframework/checker-qual/3.22.1/checker-qual-3.22.1.module
A org/checkerframework/checker-qual/3.22.1/checker-qual-3.22.1.module.asc
A org/checkerframework/checker-qual/3.22.1/checker-qual-3.22.1.module.asc.md5
A org/checkerframework/checker-qual/3.22.1/checker-qual-3.22.1.module.asc.sha1
A org/checkerframework/checker-qual/3.22.1/checker-qual-3.22.1.module.md5
A org/checkerframework/checker-qual/3.22.1/checker-qual-3.22.1.module.sha1
A org/checkerframework/checker-qual/3.22.1/checker-qual-3.22.1.pom
A org/checkerframework/checker-qual/3.22.1/checker-qual-3.22.1.pom.asc
A org/checkerframework/checker-qual/3.22.1/checker-qual-3.22.1.pom.asc.md5
A org/checkerframework/checker-qual/3.22.1/checker-qual-3.22.1.pom.asc.sha1
A org/checkerframework/checker-qual/3.22.1/checker-qual-3.22.1.pom.md5
A org/checkerframework/checker-qual/3.22.1/checker-qual-3.22.1.pom.sha1
A org/jsoup/jsoup/1.15.1/LICENSE
A org/jsoup/jsoup/1.15.1/jsoup-1.15.1-sources.jar
A org/jsoup/jsoup/1.15.1/jsoup-1.15.1-sources.jar.asc
A org/jsoup/jsoup/1.15.1/jsoup-1.15.1-sources.jar.asc.md5
A org/jsoup/jsoup/1.15.1/jsoup-1.15.1-sources.jar.asc.sha1
A org/jsoup/jsoup/1.15.1/jsoup-1.15.1-sources.jar.md5
A org/jsoup/jsoup/1.15.1/jsoup-1.15.1-sources.jar.sha1
A org/jsoup/jsoup/1.15.1/jsoup-1.15.1.jar
A org/jsoup/jsoup/1.15.1/jsoup-1.15.1.jar.asc
A org/jsoup/jsoup/1.15.1/jsoup-1.15.1.jar.asc.md5
A org/jsoup/jsoup/1.15.1/jsoup-1.15.1.jar.asc.sha1
A org/jsoup/jsoup/1.15.1/jsoup-1.15.1.jar.md5
A org/jsoup/jsoup/1.15.1/jsoup-1.15.1.jar.sha1
A org/jsoup/jsoup/1.15.1/jsoup-1.15.1.pom
A org/jsoup/jsoup/1.15.1/jsoup-1.15.1.pom.asc
A org/jsoup/jsoup/1.15.1/jsoup-1.15.1.pom.asc.md5
A org/jsoup/jsoup/1.15.1/jsoup-1.15.1.pom.asc.sha1
A org/jsoup/jsoup/1.15.1/jsoup-1.15.1.pom.md5
A org/jsoup/jsoup/1.15.1/jsoup-1.15.1.pom.sha1
ap...@google.com <ap...@google.com> #24
Branch: androidx-main
commit 256ff48d4ce39ae8a91ed939a2559897b079ca6a
Author: Jelle Fresen <jellefresen@google.com>
Date: Tue Mar 12 15:28:16 2024
Added accessibility checks to ComposeUiTest
Adds implementation of accessibility checks on Android.
In common code, you can use the enable/disable methods on ComposeUiTest
and ComposeTestRule, and call them manually with
tryPerformAccessibilityChecks. In android code, you can get, set and
configure the AccessibilityValidator from the Accessibility Test
Framework (ATF) that does the actual work. This allows you, for example,
to reuse an AccessibilityValidator from somewhere else.
Fix: 198122348
Test: Added AccessibilityChecksTest
Relnote: "Added API to run accessibility checks, which analyze the UI
and report any accessibility problems. The implementation is platform
dependend, and currently only supported on Android, using the
Accessibility Test Framework for Android."
Change-Id: Idd0cc6eabb65803a223171a5fce7a71f871428e4
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/text/HandwritingTestUtils.kt
M compose/ui/ui-test-junit4/api/current.txt
M compose/ui/ui-test-junit4/api/restricted_current.txt
M compose/ui/ui-test-junit4/src/androidMain/kotlin/androidx/compose/ui/test/junit4/AndroidComposeTestRule.android.kt
M compose/ui/ui-test-junit4/src/jvmMain/kotlin/androidx/compose/ui/test/junit4/ComposeTestRule.jvm.kt
M compose/ui/ui-test/api/current.txt
M compose/ui/ui-test/api/restricted_current.txt
M compose/ui/ui-test/build.gradle
A compose/ui/ui-test/samples/src/main/java/androidx/compose/ui/test/samples/AccessibilityChecksSamples.kt
M compose/ui/ui-test/samples/src/main/java/androidx/compose/ui/test/samples/Common.kt
A compose/ui/ui-test/src/androidInstrumentedTest/kotlin/androidx/compose/ui/test/AccessibilityChecksTest.kt
M compose/ui/ui-test/src/androidMain/kotlin/androidx/compose/ui/test/Actions.android.kt
M compose/ui/ui-test/src/androidMain/kotlin/androidx/compose/ui/test/ComposeUiTest.android.kt
M compose/ui/ui-test/src/androidMain/kotlin/androidx/compose/ui/test/TestContext.android.kt
M compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/Actions.kt
M compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/ComposeUiTest.kt
M compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/TestContext.kt
M compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/TextActions.kt
M compose/ui/ui-test/src/commonStubsMain/kotlin/androidx/compose/ui/test/Actions.commonStubs.kt
M compose/ui/ui-test/src/commonStubsMain/kotlin/androidx/compose/ui/test/ComposeUiTest.commonStubs.kt
M gradle/verification-metadata.xml
ap...@google.com <ap...@google.com> #25
Branch: androidx-main
commit 59b0ccf3a4061f48177e88b8b823d0b3ad2947db
Author: Jelle Fresen <jellefresen@google.com>
Date: Tue Mar 12 15:40:53 2024
Add platform specific extension to TestContext
To facilitate storing platform specific elements in TestContext, a new
PlatformTestContext expect/actual has been introduced. This can be
accessed from the TestContext with `testContext.platform`. When using
this on a certain platform, you will have access to all the platform
specific elements defined for that platform. Currently, no elements have
been added for any platform, but in a future commit the Android version
will get an AccessibilityValidator.
Bug: 198122348
Test: presubmit
Change-Id: Iddc3d2585267a181161d5774df6b658f73155462
A compose/ui/ui-test/src/androidMain/kotlin/androidx/compose/ui/test/TestContext.android.kt
M compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/TestContext.kt
A compose/ui/ui-test/src/commonStubsMain/kotlin/androidx/compose/ui/test/TestContext.commonStubs.kt
na...@google.com <na...@google.com> #26
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.annotation:annotation-mingwx64:1.9.0-alpha02
st...@gmail.com <st...@gmail.com> #27
Double-checking: is androidx.annotation:annotation-mingwx64
actually where this fixed was located?
ia...@google.com <ia...@google.com> #28
Those last couple of changes were in androidx.compose.ui.test.
hy...@salesforce.com <hy...@salesforce.com> #29
je...@google.com <je...@google.com> #30
I'm not sure why androidx.annotation
is mentioned, that seems to be a red herring. The above commits landed for compose version 1.8.0-alpha01
.
st...@gmail.com <st...@gmail.com> #31
Thank you!
Description
Jetpack Compose release version: 1.0 Android Studio Build: Kotlin version:
Do ComposeTest supports Accessibility test like what we have for Espresso using AccessibilityChecks.enable, If not then any future roadmap to bring