Detox: Is it possible to send "Done" or "Go" to the keyboard?

Created on 22 Jul 2017  路  5Comments  路  Source: wix/Detox

Is it possible to use typeText to send keyboard events other than typing letters into forms?

questiostack overflow

Most helpful comment

Detox uses EarlGrey to interact with the UI (among other things). Take a look at these examples here, https://github.com/google/EarlGrey/issues/248

In brief, you can typeText \n or match by.label('return') and tap on the matched view.

All 5 comments

Detox uses EarlGrey to interact with the UI (among other things). Take a look at these examples here, https://github.com/google/EarlGrey/issues/248

In brief, you can typeText \n or match by.label('return') and tap on the matched view.

Closed by mistake, please close if this answers your question.

That's great! Thank you.

@rotemmiz, sorry for reopen this

I just got a slight difficulty for pressing enter on a numpad keyboard. It doesn't have Enter keyboard so when I wanna press Enter, it just tell me that
GREYKeyboard: No known SHIFT key was found in the hierarchy.

Thanks for helping out.

If you have a login screen then use "\n" at the end of the field you want the keyboard to close.

e.g:

    await element(by.id('UsernameTestId')).typeText('username');
    await element(by.id('PasswordTestId')).typeText('password\n');
    await element(by.id('LoginTestId')).tap();
Was this page helpful?
0 / 5 - 0 ratings