Appium/WebdriverIO, how to use ~ accessibility selector on the Web?

Hello,

I have a iOS, Android and Web application that share the same code base (using react-native and react-native-web), I want to share the codebase of our e2e tests at the best possible.

After reading the accessibility id selector here: https://webdriver.io/docs/selectors/#accessibility-id

I was able to use $('~MyButton') to click on my button for both iOS and Android.

Can the Accesibility ID selector work also on the Web?

If yes, what attribute should I use on my element as I don’t think web use an accessibilityId attribute.

If no, what strategy do you recommend to prevent having to maintain many selectors for each platforms?

Thanks!