Skip to content

Doubao-powered voice input for Linux, Wayland and Omarchy

fix: stabilize synthetic dictation cancellation test

quanru3eb110b08bb9
diff --git a/tests/e2e/cases/runtime.yaml b/tests/e2e/cases/runtime.yaml
index bbb2f63..9fd9f0b 100644
--- a/tests/e2e/cases/runtime.yaml
+++ b/tests/e2e/cases/runtime.yaml
@@ -26,12 +26,12 @@ cases:
- aiAssert: The recording overlay is visible and the target field is still empty.
- computer.keyPress: { keyName: Escape }
- aiWaitFor:
- prompt: The overlay is gone and the status says Cancelled, no text delivered, and ready to try again.
+ prompt: The large Synthetic dictation delivery target window shows an empty text field and the status Cancelled · no text delivered · ready to try again. The small floating recording panel with Listening to synthetic speech is not visible.
options: { timeoutMs: 30000, checkIntervalMs: 1000 }
- - aiAssert: The target field remains empty and the status says Cancelled, no text delivered, and ready to try again.
+ - aiAssert: In the Synthetic dictation delivery target window, the text field is empty and the status reads Cancelled · no text delivered · ready to try again. No floating panel says Listening to synthetic speech.
- computer.keyPress: { keyName: F8 }
- aiWaitFor:
- prompt: A new recording overlay is visible.
+ prompt: A small floating recording panel says Listening to synthetic speech and Synthetic dictation is ready to deliver.
options: { timeoutMs: 30000, checkIntervalMs: 1000 }
- computer.keyPress: { keyName: F8 }
- aiWaitFor:
diff --git a/tests/e2e/gtk_runtime_fixture.py b/tests/e2e/gtk_runtime_fixture.py
index 4706414..cc9e125 100644
--- a/tests/e2e/gtk_runtime_fixture.py
+++ b/tests/e2e/gtk_runtime_fixture.py
@@ -76,6 +76,11 @@ def build_runtime_fixture():
worker=ImmediateWorker(),
)
+ def restore_target_focus():
+ window.present()
+ window.set_focus(target)
+ target.grab_focus()
+
def key_pressed(_controller, keyval, _keycode, _modifiers):
if keyval == Gdk.KEY_F8:
if state["recording"]:
@@ -88,9 +93,7 @@ def build_runtime_fixture():
def close_overlay_and_restore_target():
overlay.hide()
- window.present()
- window.set_focus(target)
- target.grab_focus()
+ restore_target_focus()
status.set_text(
f"Delivered once · {state['deliveries']} delivery"
)
@@ -105,6 +108,7 @@ def build_runtime_fixture():
if keyval == Gdk.KEY_Escape and state["recording"]:
state["recording"] = False
overlay.hide()
+ restore_target_focus()
status.set_text("Cancelled · no text delivered · ready to try again")
return True
return False