Detox: typeText and clearText sometimes fail due to keyboard sync

We sometimes have sync problems with the keyboard not shown yet:

2016-10-08 01:47:39.567 example[38497:4275833] Detox Test Failed: Element matcher: (respondsToSelector(accessibilityIdentifier) && accessibilityID("UniqueId005")) Complete Error: Error Domain=com.google.earlgrey.ElementInteractionErrorDomain Code=1 "Failed to type string "", because keyboard was not shown on screen." UserInfo={NSLocalizedDescription=Failed to type string "", because keyboard was not shown on screen.}

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 15 (7 by maintainers)

Commits related to this issue

Most upvoted comments

I have always click on the input before type text on the tests like humans, not robots. And don’t see any problems.

Hey @mrozbarry, it makes it hard for us to track progress of closed issues. So if you have any progress regarding keyboard handling please open a new issue, or even better, if you want to offer a PR with bug fix or documentation we’ll gladly accept it.

I don’t remember toggling keyboard setting as @LeoNatan mentions. However, when I check Hardware/Keyboard in my simulator, I can see that SW keyboard is turned off.

It made sense to turn it on, and I could see the difference right away, when focusing on input field.

Running my test case after this change, it worked as I would expect.

This can happen if you’ve played around with CMD+H (soft keyboard) or CMD+SHIFT+H (hardware keyboard). Restore those to default and make sure that the keyboard appears on screen when making a text field a first responder. Or use replaceText.