Skip to content

Doubao-powered voice input for Linux, Wayland and Omarchy

test: simulate onboarding sign-in in Midscene

quanruc49ebbf8364a
diff --git a/tests/midscene/README.md b/tests/midscene/README.md
index d732420..15b23fa 100644
--- a/tests/midscene/README.md
+++ b/tests/midscene/README.md
@@ -45,11 +45,14 @@ The manual experimental workflow now continues from that installed base image:
Omarchy/Hyprland guest session.
The ordinary Ubuntu stage maps the real GTK onboarding window inside the
-headless Midscene desktop. Its synthetic fixture performs no login, recording,
-network request, paste, or user-settings read. Midscene visually navigates to
-the shortcut page, runs the fake endpoint check, verifies its visible feedback,
-continues to the voice page, checks that navigation reset the scroll position,
-and completes setup. The HTML replay is uploaded for every run.
+headless Midscene desktop. Its synthetic fixture starts signed out, opens an
+explicitly labelled CI-only sign-in window, and simulates a successful return
+without a network request or real credentials. It also performs no recording,
+paste, or user-settings read. Midscene verifies the automatic transition to the
+microphone step, visually navigates to the shortcut page, runs the fake endpoint
+check, verifies its visible feedback, continues to the voice page, checks that
+navigation reset the scroll position, and completes setup. The HTML replay is
+uploaded for every run.
The AI stage needs a multimodal model credential. Its `MIDSCENE_MODEL_*`
configuration is stored only as GitHub Actions Secrets; tests contain only
diff --git a/tests/midscene/e2e/omarchy-onboarding.test.ts b/tests/midscene/e2e/omarchy-onboarding.test.ts
index 57bab2a..ba57d14 100644
--- a/tests/midscene/e2e/omarchy-onboarding.test.ts
+++ b/tests/midscene/e2e/omarchy-onboarding.test.ts
@@ -65,7 +65,19 @@ describe.skipIf(process.env.OMARCHY_E2E !== 'true')(
it('runs the onboarding flow in the real Omarchy desktop session', async () => {
await agent.aiAct(
- 'Verify the Omarchy desktop visibly contains the Doubao Say window on the Microphone step with a Next button in its fixed top navigation.',
+ 'Verify the Omarchy desktop visibly contains the Doubao Say window on the Sign in step, says the user is not signed in, and shows an Open Doubao sign-in button. Do not click anything.',
+ );
+ await agent.aiAct(
+ 'In the Doubao Say window, click Open Doubao sign-in exactly once, then stop immediately.',
+ );
+ await agent.aiAct(
+ 'Verify a Synthetic Doubao sign-in window is visible and explicitly says it is CI-only, makes no network request, and uses no real credentials. Do not click anything.',
+ );
+ await agent.aiAct(
+ 'In the Synthetic Doubao sign-in window, click Simulate successful sign-in exactly once, then stop immediately.',
+ );
+ await agent.aiAct(
+ 'Verify the synthetic sign-in window closed and the Doubao Say window automatically advanced to the Microphone step with a Next button in its fixed top navigation.',
);
await agent.aiAct(
'Click Next in the Doubao Say fixed top navigation exactly once, then stop immediately. ' +
diff --git a/tests/midscene/e2e/onboarding.test.ts b/tests/midscene/e2e/onboarding.test.ts
index 1843dca..39eda22 100644
--- a/tests/midscene/e2e/onboarding.test.ts
+++ b/tests/midscene/e2e/onboarding.test.ts
@@ -94,7 +94,19 @@ describe('Doubao Say onboarding', () => {
it('navigates, reports endpoint feedback, resets scroll and completes setup', async () => {
await agent.aiAct(
- 'Verify the visible Doubao Say window is on the Microphone step and has a Next button in the fixed top navigation.',
+ 'Verify the visible Doubao Say window starts on the Sign in step, says the user is not signed in, and shows an Open Doubao sign-in button. Do not click anything.',
+ );
+ await agent.aiAct(
+ 'Click Open Doubao sign-in exactly once, then stop immediately.',
+ );
+ await agent.aiAct(
+ 'Verify a Synthetic Doubao sign-in window is visible and explicitly says it is CI-only, makes no network request, and uses no real credentials. Do not click anything.',
+ );
+ await agent.aiAct(
+ 'In the Synthetic Doubao sign-in window, click Simulate successful sign-in exactly once, then stop immediately.',
+ );
+ await agent.aiAct(
+ 'Verify the synthetic sign-in window closed and the visible Doubao Say window automatically advanced to the Microphone step with a Next button in the fixed top navigation.',
);
await agent.aiAct(
diff --git a/tests/midscene/gtk_fixture.py b/tests/midscene/gtk_fixture.py
index 77397f7..6a92fd5 100644
--- a/tests/midscene/gtk_fixture.py
+++ b/tests/midscene/gtk_fixture.py
@@ -18,7 +18,7 @@ def main():
Gtk.init()
set_language("en")
state = AppState()
- state.login_status = LoginStatus.LOGGED_IN
+ state.login_status = LoginStatus.NOT_LOGGED_IN
settings = Settings(
polish_enabled=True,
polish_base_url="https://example.invalid/v1",
@@ -36,6 +36,58 @@ def main():
}
holder = {}
+ def show_synthetic_login():
+ existing = holder.get("login")
+ if existing:
+ existing.present()
+ return
+
+ login = Gtk.Window(title="Doubao Say — Synthetic sign-in")
+ login.set_default_size(520, 280)
+ login.set_resizable(False)
+ login.set_modal(True)
+ login.set_transient_for(holder["control"].window)
+
+ content = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=18)
+ for side in ("start", "end", "top", "bottom"):
+ getattr(content, "set_margin_" + side)(32)
+ login.set_child(content)
+
+ heading = Gtk.Label(
+ label="Synthetic Doubao sign-in",
+ xalign=0,
+ )
+ heading.add_css_class("title-2")
+ content.append(heading)
+ content.append(Gtk.Label(
+ label=(
+ "CI-only window. It makes no network request and uses no real "
+ "credentials."
+ ),
+ xalign=0,
+ wrap=True,
+ ))
+
+ success = Gtk.Button(label="Simulate successful sign-in")
+ success.add_css_class("suggested-action")
+ content.append(success)
+
+ def signed_in(*_args):
+ holder["login"] = None
+ login.destroy()
+ state.login_status = LoginStatus.LOGGED_IN
+ holder["control"].advance_after_login()
+
+ success.connect("clicked", signed_in)
+
+ def closed(*_args):
+ holder["login"] = None
+ return False
+
+ login.connect("close-request", closed)
+ holder["login"] = login
+ login.present()
+
def test_endpoint(_settings, _key, done):
def finish():
done("Synthetic endpoint response", None)
@@ -66,7 +118,7 @@ def main():
)
control = ControlWindow(
state,
- on_login_clicked=lambda: None,
+ on_login_clicked=show_synthetic_login,
on_quit_clicked=lambda: None,
on_check_mic_clicked=lambda: None,
actions=actions,