Is your feature request related to a problem? Please describe.
I would like to use Detox e2e testing for my NativeScript apps because I am not a fan of Appium. NativeScript core supports Appium (automationText) but that property doesn't work for standard Detox practices.
Describe the solution you'd like
I would like to add a testID property like in React Native projects that can be used in Detox. Using the same property name would mean the same testing techniques used in React Native tutorials would also apply to NativeScript apps.
Describe alternatives you've considered
NativeScript already has the automationText property which is pretty much for the same purpose but has been specific to Appium in the past. On Android, the automationText property only sets the content description, which works for Detox's by.label() matcher but not for by.id() (which is more standard it seems). We could set the tag as well as the content description at the same time then by.id() would work, but then there would be no differentiation between by.label() and by.id().
If we create a testID property the mappings would work like:
testID -> by.id()automationText -> by.label()If we modify the behavior of automationText the mappings would be:
automationText -> by.id()automationText -> by.label()One thing to note is that iOS already behaves like this because it sets the accessibilityIdentifier and accessibilityLabel at the same time.
Additional context
Detox Matcher Docs
@keerl this seems really awesome! Do you have a working example with detox?
@farfromrefug you can checkout the Detox plugin PR I have in right now and quickly get it running.
README: https://github.com/keerl/plugins/tree/feature/detox/packages/detox
PR: https://github.com/NativeScript/plugins/pull/23
Fantastic @keerl
Most helpful comment
@farfromrefug you can checkout the Detox plugin PR I have in right now and quickly get it running.
README: https://github.com/keerl/plugins/tree/feature/detox/packages/detox
PR: https://github.com/NativeScript/plugins/pull/23