Is there a way to access test id's using expo web?

I’m trying to run end to end tests on an Expo Web project with Playwright. I was hoping that when I added a testId prop to a React Native element it would be converted to a data-testid so I could select the element for my tests. I also tried adding a data-testid attribute to the element, but that didn’t work either.

As a result, I can’t figure out a good way to select the elements. So far the best thing I can come up with is to add an accessibility label to the element.

Is it possible to add data elements to expo web projects? If not, does anyone know a better way to add test id’s to react-native expo projects that’ll be tested on the web?

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