You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using Jest and Detox for mobile automation testing on iOS simulators. However, I am encountering a recurring issue where the iOS simulator keyboard interferes with my tests, causing them to fail.
The main problem arises when the keyboard remains open after entering text into an input field, which disrupts subsequent test steps. The usual methods I’ve tried to close the keyboard include:
Tapping on a different element to dismiss the keyboard
or typeText('\n') to close it
Also tried adding this defaults write com.apple.iphonesimulator ConnectHardwareKeyboard -bool false added as a step in CI
Unfortunately, these methods are not consistently reliable. Additionally, the keyboard’s opening or closing animations sometimes cause tests to break, leading to flaky tests.
I am seeking a solution to disable the iOS simulator keyboard before running tests.
Tapping on a different element to dismiss the keyboard
Did you try tapping on a specific point on the screen's container to dismiss the keyboard? If that doesn’t work, it might also affect real users. Worth trying with a small swipe().
We’ll soon have a new API, device.tap(point), that should help with this.
I don't have this issue with versions preceding 20.23.1, after the update the keyboard doesn't dismiss or hide in any way and resolving with .tapReturnKey() it's unfeasible, we have hundreds of tests to change.
I'm using [email protected] and iPhone15.
After hours of trial and error figured out using .replaceText(...) opened the keyboard in a weird state which stopped the known workarounds to dismiss the keyboard. Using .typeText(...) worked for me.
A reliable way to completely disable the soft keyboard would be very helpful.
I am using Jest and Detox for mobile automation testing on iOS simulators. However, I am encountering a recurring issue where the iOS simulator keyboard interferes with my tests, causing them to fail.
The main problem arises when the keyboard remains open after entering text into an input field, which disrupts subsequent test steps. The usual methods I’ve tried to close the keyboard include:
defaults write com.apple.iphonesimulator ConnectHardwareKeyboard -bool false
added as a step in CIUnfortunately, these methods are not consistently reliable. Additionally, the keyboard’s opening or closing animations sometimes cause tests to break, leading to flaky tests.
I am seeking a solution to disable the iOS simulator keyboard before running tests.
Your environment
Detox version: 20.25.5
React Native version: 0.74.1
Node version: 20.15.1
Device model:
OS: 17
Test-runner (select one): jest
The text was updated successfully, but these errors were encountered: