Bashir Abdelwahed
Bashir Abdelwahed

Reputation: 512

UI testing for react native apps

i am currently working on a UI automated testing project.

my job is to do UI automated testing on applications built via react-native.

the problem is that react-native doesn't provide resource-id.

i tried nativeID, and testID, and it didn't work out.

i tried accessibilityLabel but this is not the way to do it, because it assigns to the content-descp: which is used by the blind mode.

i tried cavy which is an integrated-ui testing tool, but it's very new, and there is not much support, plus it's not quit developped yet.

i tried selendroid, but i am facing some problems while loading the app in the local selendroid server, i think it has something to do with react native.

any help please!

Upvotes: 0

Views: 1529

Answers (2)

ajinkya
ajinkya

Reputation: 41

You can add AccessbiltiyLabel so that you will be able to automate via driver.findElement(by.accessibility("id");

Upvotes: 1

hyb175
hyb175

Reputation: 1291

On the project I’m working on right now, we are using Calabash for both Android and iOS. testID works with Calabash like this: If you have a view with testID some-id, then you can query for it in calabash with query string ”* marked: some-id”

https://github.com/calabash/calabash-ios

I have also heard people having success with Appium, which is quite similar I think.

Upvotes: 2

Related Questions