I've just installed detox for the first time to add some e2e test coverage for the iOS mobile app.
I've tried adding testID to the text fields but that does not seem to work.
const renderPhoneNumberInput = () => {
return (
<TextInputCustom
title="Mobile Number"
value={phoneNumber}
onChangeText={setPhoneNumber}
keyboardType={'phone-pad'}
testID='phoneNumberField'
/>
);
};
await expect(element(by.id('phoneNumberField'))).toBeVisible();
When the test is executed it fails on:
DetoxRuntimeError: Test Failed: No elements found for “MATCHER(identifier == “phoneNumberField”)”
I will just add that for some reason the testID added to the text field is underlined with a message :
"TS2322: Type '{ title: string; value: string; onChangeText: Dispatch<SetStateAction>; keyboardType: "phone-pad"; testID: string; }' is not assignable to type 'IntrinsicAttributes & Props'. Property 'testID' does not exist on type 'IntrinsicAttributes & Props'."