NativeScript/NativeScript

Child components of ActionBar not accessibility friendly.

kseeman opened this issue · 2 comments

Please, provide the details below:

Tell us about the problem

While trying to create UI automated tests with Appium we've noticed that the child components of ActionBar, such as ActionItem and NavigationButton don't have a property for AutomationText. When running UiAutomatorViewer, these objects are marked as NAF (Not Accessibility Friendly). This prevents us from allowing any accessibility features for the navigation buttons that we have in our app, as well as not allowing UI automation to be possible for those features. Is it possible to have the AutomationText property added to the child components of ActionBar? If not, what are some other UI automation strategies to handle situations like these?

Which platform(s) does your issue occur on?

Only confirmed for Android.

Please provide the following version numbers that your issue occurs with:

  • CLI: 2.5.0
  • Cross-platform modules: 2.5.1
  • Runtime(s): Android: 2.5.0

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Our Test Engineer has been harassing us about this functionality too--I hope someone has a solution!

The best I can come up with is styling a component to look like an action bar so we can use normal components that have automationText as a settable property, which I think is a pretty awful solution.

m-abs commented

Hi,

Accessibility is important for our team as well.
We have written a plugin to improve NativeScript support for the various features: https://www.npmjs.com/package/@nota/nativescript-accessibility-ext

Unfortunately it won't help you with the ActionItem.
You can't as @kseeman mentioned set automationText on an ActionItem, this is because the native element on android only supports a text property.
#2796 (comment)

I don't know about your specific case, but we've solved our needs by setting both an icon and text property on our ActionItem. This create a icon-button that the screen reader on both iOS and Android will read as the text property.

I hope it's not in too bad taste, but if you're interested in working with us on accessibility in NativeScript you could ping me on the slack channel under the handle "m_abs" :)