Reputation: 1225
When using detox matcher by class name i.e. by.type(className)
https://github.com/wix/Detox/blob/master/docs/APIRef.Matchers.md#bytypeclassname
Is it possible to change the classname depending on the platform the test is running on (ios/android)
e.g. element(by.type(className))
becomes:
element(by.type('android.widget.ImageView'))
on androidelement(by.type('RCTImageView'))
on iosUpvotes: 1
Views: 1710
Reputation: 57050
Use device.getPlatform()
to determine the current device platform.
Documentation: https://github.com/wix/Detox/blob/master/docs/APIRef.DeviceObjectAPI.md#devicegetplatform
Upvotes: 2