React-native: [Android][0.60.0] AccessibilityLabels has extra characters coma and space at the end

Created on 10 Jul 2019  Â·  11Comments  Â·  Source: facebook/react-native

React Native version: 0.60

Steps To Reproduce

  1. add an accessibilityLabel to an element

  2. build your app

  3. use a tool (we are using Appium) to read/interact with your accessibilityID on your Android app

  4. your accessibility ID presents an additional coma and space

Describe what you expected to happen:
Expect same behavior than .59 version
to have accessibilityID = TestLabel

Snack, code example, or link to a repository:
accessibilityLabel={'TestLabel'}
onPress={() => this.onPressLogin()}
hierarchy={ButtonHierarchy.Secondary}
/>

Bug Android

Most helpful comment

Any update ? I am having the same issue. In my projects I used AccessibilityLabel for automated tests. After update all tests get failure.

All 11 comments

Any update ? I am having the same issue. In my projects I used AccessibilityLabel for automated tests. After update all tests get failure.

Hello,

Unfortunately still didn't get any support :(

Regards

On Fri, Jul 26, 2019, 21:13 Cássio Seffrin notifications@github.com wrote:

Any update ? I am having the same issue. In my projects I used
AccessibilityLabel for automated tests. After update all tests get failure.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/facebook/react-native/issues/25581?email_source=notifications&email_token=AK3D55NLB5VUNKGIJ6QBZMDQBNLFRA5CNFSM4H7XQYPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD25S55Q#issuecomment-515583734,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AK3D55LAVVPFJ3UI5IU7OHLQBNLFRANCNFSM4H7XQYPA
.

It doesn't matter if you inspect the element with Appium or just with the Android Studio Layout inspector (because Appium translates the the views to XML), the , is being added to each accessibilityLabel, see the image below.

I've also been trying to find the code in RN that is responsible for the translation in Android to translate the accessibilityLabel to content-desc, but I couldn't find it. If someone can point me to that I can try to fix it with a PR

image

@FutureGUIs

Thanks for finding this, I made a remark in the PR and asked for the background of this change

Seems it's been fixed with https://github.com/facebook/react-native/commit/812abfd and the fix was released with 0.60.5. I think it might could be closed now?

I just give a try with 0.60.5 and I still have that coma after the accessibility label I will clean everyting and update the status asap

0.60.5 fixed issue for me.

Same on my side It is working again. Thanks for that!!!

Updated my app to 0.60.5 and it works, @kelset, I think this issue can be closed now

git add .
git commit -m 'update v0.60'
react-native upgrade

These steps above have solved the issue, Thks!

Was this page helpful?
0 / 5 - 0 ratings