expo:build android stripping accessiblityLabel / content-desc properties

Hi,

I’ve been using the accessibilityLabel property to provide hooks for my Appium based automation and this has worked really well when running the automation against the app running in the Expo Client app.

When I built the standalone version of the app as part of preparing to move my automation to a cloud provider I encountered an issue where the content-desc attribute on Android (that the accessibilityLabel prop is setting) is being stripped.

Here’s a link to some screenshots (I can’t post more than 1 picture or post more than two links so I’m limited in options to show what’s happening) https://twitter.com/colinwren/status/1310007469062737923

As you can see the element above the one being highlighted should have a content-desc of Experience Tab but in the standalone version it doesn’t.

I’ve created a snack here Standalone app strips content-desc on Android - Snack that implements the approach I’m using with react-navigation’s tabBarTestId option although I’m not sure how easy it is to create a standalone build from that.

Any help understanding why these attributes may be being stripped would be very much appreciated as this prevents me from being able to run my automation tests against the standalone app and I’d like to do this to ensure it works before I publish to the store.

Thanks!

Diagnostics output:

Expo CLI 3.27.10 environment info:
    System:
      OS: Linux 5.4 Ubuntu 20.04.1 LTS (Focal Fossa)
      Shell: 5.0.17 - /bin/bash
    Binaries:
      Node: 14.4.0 - ~/.nvm/versions/node/v14.4.0/bin/node
      Yarn: 1.22.4 - ~/.nvm/versions/node/v14.4.0/bin/yarn
      npm: 6.14.8 - ~/.nvm/versions/node/v14.4.0/bin/npm
    npmPackages:
      expo: ~38.0.0 => 38.0.8 
      react: ~16.11.0 => 16.11.0 
      react-dom: ^16.13.1 => 16.13.1 
      react-native: https://github.com/expo/react-native/archive/sdk-38.0.0.tar.gz => 0.62.2 
      react-native-web: 0.11.7 => 0.11.7 
    npmGlobalPackages:
      expo-cli: 3.27.10
    Expo Workflow: managed

Please ignore this, turns out someone had previously installed a babel extension to remove these and while it was removed the cache hadn’t been cleared. Using api.cache(false) in the babel; config restored these

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.