wix / react-native-navigation

A complete native navigation solution for React Native
https://wix.github.io/react-native-navigation/
MIT License
13.04k stars 2.67k forks source link

setDefaultOptions backButton testID and accessibilityLabel do not work as expected #7028

Open robrechtme opened 3 years ago

robrechtme commented 3 years ago

🐛 Bug Report

Passing a testID or accessibilityLabel through defaultOptions does not work as expected. This duplicates https://github.com/wix/react-native-navigation/issues/6669, but hopefully provides more info. If you want, I can look into submitting a PR.

To Reproduce

Navigation.setDefaultOptions({
  backButton: {
    icon: require('../assets/images/arrowBack.png'),
    testID: 'customTestID',
    accessibilityLabel: 'customA11yLabel',
  },
});

Expected behavior

The custom testID and/or accessibilityLabel show up in Appium. According to the docs, accessibilityLabel is only supported on Android, but testID should work on both platforms.

Actual Behavior

Screenshot 2021-03-12 at 13 41 46

A custom testID on a button in topBar.leftButtons or topBar.rightButtons however does show up in Appium.

Your Environment

retyui commented 3 years ago

Issue with accessibilityLabel fixed on Android and

Issue with testID on Android fixed in https://github.com/wix/react-native-navigation/pull/7298 (PR in review)

robrechtme commented 2 years ago

Nice! This is fixed on Android now. On iOS we still cannot configure the a11yLabel or testID. They will always be set to the title of the previous screen (unless there is no title, then it is 'Back').

VNDRN commented 2 years ago

On iOS we still cannot configure the a11yLabel or testID. They will always be set to the title of the previous screen (unless there is no title, then it is 'Back').

Is there any update on this issue? We are still experiencing this on iOS.