Detox: typeText fails on iOS with Detox `13.3.1`
Describe the bug
✅typeText
succeeds with Detox 13.1.1
, 13.2.0
(old)
⚠️typeText
fails with Detox 13.3.1
(new)
To Reproduce
- I have tested this issue on the latest Detox release and it still reproduces
Provide the steps necessary to reproduce the issue. If you are seeing a regression, try to provide the last known version where the issue did not reproduce.
const emailTextBox = element(by.text('Email Address'));
await emailTextBox.typeText(emailAddress);
This is a regression.
13.2.0
worked fine
13.3.0
and 13.3.1
do not work.
If possible, please provide a small demo project that reproduces the issue, or attach a video with the reproduction - this would be very appreciated.
Expected behavior It should simulate typing into text box.
Screenshots If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
- Detox:
13.3.1
- React Native:
0.59.10
- Node:
10.16.0
- Device:
MacBook Pro -- iPad 6th Generation Simulator
- Xcode:
10.3 (10G8)
- iOS:
12.4
- macOS:
Mojave 10.14.6 (18G84)
Device and Verbose Detox Logs
detox test --loglevel trace
: e2e.log
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 31 (15 by maintainers)
We have a plan to replace the entire matching and action infrastructure for Detox on iOS. I will see what can be done there. Closing for now.
I changed the entire typing mechanism to an internal one, instead of what we used in the past, which was Earl Grey based, and had many issues. The new system is supposed to be more robust, but that also means that it is more general in design. Again, if you have ideas how to solve the issues I’ve brought up before, let’s discuss. This is why the issue remains open.
Thanks @LeoNatan for the quick turnaround and in-depth explanations. I understand if you don’t want to support the scenario given the hairiness of the implementation details. My team will proceed with the
by.id
guidance until we hear otherwise.@ayelenmarie I think your issue is different than the one discussed in this thread originally, but due to lazy error reporting in the code, got lumped in the same category. Please see if 14.0.2 solved your issue.
Detox 14.0.2 is out with the proposed changes. Please try it out and let me know if something improves, or post the new error output. Thanks
@PaulMest @ayelenmarie
There is a PR open with improvements to typing. Let’s see if it helps in these cases. Even if not, it will provide better error messages.
In the case of a placeholder, I don’t think it will be supported. When you select the placeholder view, it’s a label, not the enclosing text field, and so you cannot type in there.
Let’s wait for the PR to see.
I don’t see why it should not be supported. I’ll try to reproduce your use case and see.
Using
by.id()
is always recommended because it’s the most precise.@muraliseveneleven Yes. Same error.
My work around was to add a
testID
and use theby.id
matcher. But I don’t want to have to do that to all of my components.