Atul Gupta
11/02/2024, 8:34 AMTextField
is there a way to simulate the keyboard backspace button while testing using androidx.compose.ui.test
?Zach Klippenstein (he/him) [MOD]
11/04/2024, 4:52 AMAtul Gupta
11/04/2024, 7:36 PMAtul Gupta
11/04/2024, 7:43 PM// moving cursor to the end
onNode(hasSetTextAction()).requestFocus().performTextInputSelection(TextRange(3, 3))
onNode(hasSetTextAction()).performKeyInput { pressKey(Key.Backspace) }
is there a more concise way to do this?
Also, I saw one more API performKeyPress
onNode(hasSetTextAction().performKeyPress(KeyEvent(???))
But I couldn’t figure out what to pass ???
while writing the test in commonTestZach Klippenstein (he/him) [MOD]
11/04/2024, 9:04 PM