@@ -158,19 +158,12 @@ def run_process_capture_logs(command, cwd, name="", process_holder=None) -> None
158
158
process .wait ()
159
159
160
160
161
- def run_typing_process (workdir , text : str ) -> None :
161
+ def run_typing_process (text : str ) -> None :
162
162
if sys .platform == "win32" :
163
- # with open(workdir / "type.ahk", "w", encoding="utf-8") as f:
164
- # f.write("SetKeyDelay 400, 100\n") # 400ms between keys, 100ms between down/up.
165
- # f.write(f"SendEvent \"{text}\"\n")
166
- # f.write("exit")
167
- # result = subprocess.run(["AutoHotkey.exe", "/ErrorStdOut", "type.ahk"], cwd=workdir)
168
- ahk .send (text , key_delay = 400 , send_mode = "Event" );
163
+ ahk .send (text , key_delay = 200 , key_press_duration = 50 , send_mode = "Event" );
169
164
else :
170
- result = subprocess .run (["xdotool" , "type" , "--delay" , "400" , text ])
171
- #logger.info(f"stdout: {result.stdout}")
172
- #logger.info(f"stderr: {result.stderr}")
173
- #assert result.returncode == 0
165
+ result = subprocess .run (["xdotool" , "type" , "--delay" , "200" , text ])
166
+ assert result .returncode == 0
174
167
175
168
176
169
def __get_parameters ():
@@ -190,10 +183,10 @@ def __get_parameters():
190
183
191
184
test_params .append (pytest .param (texts [0 ], examples [0 ]))
192
185
test_params .append (pytest .param (texts [1 ], examples [0 ]))
193
- # test_params.append(pytest.param(texts[0], examples[1]))
194
- # test_params.append(pytest.param(texts[0], examples[2]))
195
- # test_params.append(pytest.param(texts[0], examples[3]))
196
- # test_params.append(pytest.param(texts[1], examples[4]))
186
+ test_params .append (pytest .param (texts [0 ], examples [1 ]))
187
+ test_params .append (pytest .param (texts [0 ], examples [2 ]))
188
+ test_params .append (pytest .param (texts [0 ], examples [3 ]))
189
+ test_params .append (pytest .param (texts [1 ], examples [4 ]))
197
190
198
191
return test_params
199
192
@@ -213,7 +206,7 @@ def test_record_and_render(app_isolation, text: str, example) -> None:
213
206
thread .start ()
214
207
time .sleep (2 )
215
208
216
- run_typing_process (app_dir , text )
209
+ run_typing_process (text )
217
210
218
211
process = processes .get ("klawa" )
219
212
if process and process .poll () is None :
0 commit comments