From cab1a10bdcfb612534e1e866cefde77102cafe6b Mon Sep 17 00:00:00 2001 From: ThearchyHelios Date: Wed, 14 Oct 2026 08:55:40 +0800 Subject: [PATCH] =?UTF-8?q?check-catalog-loop=EF=BC=9A=E8=A1=A8=E5=8A=A9?= =?UTF-8?q?=E6=89=8B=E7=9A=84=E8=BE=93=E5=85=A5=E6=A1=86=E8=BF=87=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E6=B3=95=E6=8A=A4=E6=A0=8F=E2=80=94=E2=80=94=E7=BB=84?= =?UTF-8?q?=E5=AD=97=E6=97=B6=E7=9A=84=E5=9B=9E=E8=BD=A6=EF=BC=88isComposi?= =?UTF-8?q?ng=E3=80=81Safari=20=E5=BC=8F=20keyCode=3D229=EF=BC=89=E4=B8=8D?= =?UTF-8?q?=E5=8F=91=E9=80=81=EF=BC=8C=E7=BB=84=E5=AD=97=E6=97=B6=E7=9A=84?= =?UTF-8?q?=20Esc=20=E4=B8=8D=E5=85=B3=E9=9D=A2=E6=9D=BF=EF=BC=8C=E8=8D=89?= =?UTF-8?q?=E7=A8=BF=E8=BF=98=E5=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/check-catalog-loop.mjs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/check-catalog-loop.mjs b/scripts/check-catalog-loop.mjs index 30828f0e..8ddc8f57 100644 --- a/scripts/check-catalog-loop.mjs +++ b/scripts/check-catalog-loop.mjs @@ -653,6 +653,16 @@ await section('表助手 · 入口、开场、提案与待保存的修改', asyn check('输入框、发送按钮有名字', (await input(page).getAttribute('aria-label')) === '给表助手的消息' && (await panel(page).locator('[data-assistant-send]').getAttribute('aria-label')) === '发送') check('还没有待保存的修改:不给保存', await panel(page).locator('[data-assistant-save]').count() === 0) + // 输入法组字时的回车是选词、Esc 是取消候选词:不发送、不关面板 + await input(page).fill('status 为') + const fire = (init) => input(page).evaluate((el, i) => el.dispatchEvent(new KeyboardEvent('keydown', { bubbles: true, cancelable: true, ...i })), init) + await fire({ key: 'Enter', isComposing: true }) + await fire({ key: 'Enter', keyCode: 229 }) + await fire({ key: 'Escape', isComposing: true }) + await sleep(300) + check('输入法组字时的回车不发送、Esc 不关面板,草稿还在', count(sent, /\/assistant$/) === 0 && await panel(page).isVisible() + && (await input(page).inputValue()) === 'status 为') + await input(page).fill('') // 第一轮:流式显示正文,提案逐项写改前、改后、依据,进待保存的修改 await say(page, SAY_1)