Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.
Python agentaichatgptdeepseekfine-tuninggemmaimage-generationllamallmllmsopenaipythonqwenreinforcement-learningself-hostedstable-diffusiontext-to-speechttsuiunsloth
Composer settings driver: poll the submitted list instead of reading it once after the key press (#12920)
Daniel Hana1b73adccad0
diff --git a/tests/studio/playwright_composer_settings.py b/tests/studio/playwright_composer_settings.pyindex b64ade26591..8697ebc33b7 100644--- a/tests/studio/playwright_composer_settings.py+++ b/tests/studio/playwright_composer_settings.py@@ -9,6 +9,7 @@ PW_ENGINE=webkit selects WebKit. PW_OUTPUT optionally saves screenshots.import jsonimport osimport re+import timefrom pathlib import Pathfrom playwright.sync_api import expect, sync_playwrightfrom _en_catalog import en_string@@ -18,6 +19,24 @@ PAGE = "/smoke-composer-settings.html"ENTRY = "/smoke-composer-settings-main.tsx"+def expect_submissions(+ submitted,+ count,+ timeout = 5.0,+):+ """The harness renders submissions from React state after the key press returns, so a+ one-shot read can still show the previous list (a macOS chrome run read the earlier+ "steer" entry where "queue" was due). Poll until exactly `count` are rendered."""+ deadline = time.monotonic() + timeout+ while True:+ value = json.loads(submitted.text_content())+ if len(value) == count:+ return value+ if time.monotonic() > deadline:+ raise AssertionError(f"expected {count} submitted messages, saw {value!r}")+ time.sleep(0.05)++def check_settings(page):plain = page.get_by_role("switch", name = en_string("composerSettings.plainText"), exact = True)context = page.get_by_role("switch", name = en_string("composerSettings.showContext"), exact = True)@@ -62,12 +81,12 @@ def check_settings(page):expect(submitted).to_have_text("[]")editor.press("Meta+Enter")expect(editor).to_have_value("")- assert json.loads(submitted.text_content()) == [+ assert expect_submissions(submitted, 1) == [{"text": "First line\nSecond line", "behavior": "steer"}]editor.fill("Queue this once")editor.press("Meta+Shift+Enter")- assert json.loads(submitted.text_content())[-1]["behavior"] == "queue"+ assert expect_submissions(submitted, 2)[-1]["behavior"] == "queue"page.reload()expect(plain).not_to_be_checked()expect(context).not_to_be_checked()@@ -83,10 +102,10 @@ def check_settings(page):editor.type("Line two")expect(editor).to_have_value("Line one\nLine two")editor.press("Enter")- assert json.loads(submitted.text_content())[-1]["behavior"] == "steer"+ assert expect_submissions(submitted, 1)[-1]["behavior"] == "steer"editor.fill("Queue override")editor.press("Control+Enter")- assert json.loads(submitted.text_content())[-1]["behavior"] == "queue"+ assert expect_submissions(submitted, 2)[-1]["behavior"] == "queue"editor.fill("Compose without sending")editor.dispatch_event("keydown", {"key": "Enter", "code": "Enter", "isComposing": True, "keyCode": 229}