@@ -163,6 +163,7 @@ def test_input_text(self):
163163 mock .patch .object (
164164 adb_utils , 'press_enter_button'
165165 ) as mock_press_enter_button ,
166+ mock .patch .object (adb_utils , 'issue_generic_request' ) as mock_issue_generic_request ,
166167 ):
167168 actuation .execute_adb_action (
168169 action , self .screen_elements , self .screen_size , self .mock_env
@@ -172,6 +173,34 @@ def test_input_text(self):
172173 'test input' , self .mock_env , timeout_sec = 10
173174 )
174175 mock_press_enter_button .assert_called_once_with (self .mock_env )
176+ mock_issue_generic_request .assert_not_called ()
177+
178+ def test_input_text_with_clear_text (self ):
179+ action = json_action .JSONAction (
180+ action_type = 'input_text' , text = 'test input' , x = 50 , y = 50 , clear_text = True
181+ )
182+ with (
183+ mock .patch .object (
184+ adb_utils , 'issue_generic_request'
185+ ) as mock_issue_generic_request ,
186+ ):
187+ actuation .execute_adb_action (
188+ action , self .screen_elements , self .screen_size , self .mock_env
189+ )
190+ mock_issue_generic_request .assert_called_once_with (
191+ [
192+ 'shell' ,
193+ 'input' ,
194+ 'keycombination' ,
195+ '113' ,
196+ '29' ,
197+ '&&' ,
198+ 'input' ,
199+ 'keyevent' ,
200+ '67' ,
201+ ],
202+ self .mock_env ,
203+ )
175204
176205 def test_scroll (self ):
177206 action = json_action .JSONAction (action_type = 'scroll' , direction = 'down' )
0 commit comments