Open TeodoraD opened 4 years ago
hi @TeodoraD, did you find any workaround for this?
Hi, @alezoffoli I didn't. But if I am honest I had not worked on this for a long time. Still, it will be good if there is some solution to this.
We could do it with detox by selecting the testID textInput
https://github.com/tttstudios/react-native-otp-input/blob/master/index.tsx#L193
await element(by.id('textInput')).atIndex(0).typeText('123456')
I believe it is a matter of selecting the correct element to fill.
Please note that there is multiple inputs with this testID, in detox we were getting an array of inputs (it is why you see the atIndex(0)
, we select the first input). When filling the first input with the full code, this library is smart enough to handle it correctly.
The testing for the app should be automated with Appium. OTPInputView is located but when trying to use sendKeys to populate the input the following error is shown: Call to 'sendKeys' failed [element.sendKeys("1")] Error response status: 12, InvalidElementState - An element command could not be completed because the element is in an invalid state (e.g. attempting to click a disabled element). Selenium error: Error Domain=com.facebook.WebDriverAgent Code=1 "'Other' is not ready for a text input. Neither the accessibility element itself nor its accessible descendants have the input focus" UserInfo={NSLocalizedDescription='Other' is not ready for a text input. Neither the accessibility element itself nor its accessible descendants have the input focus}
In Android, it is possible to locate the separate pins of the input and populate it. But they are not shown for ios.