From 7cb74cce78cb3c6e0740934143d5e122ee6e162c Mon Sep 17 00:00:00 2001 From: mesalogo Date: Thu, 1 Oct 2026 22:13:42 +0800 Subject: [PATCH] test: account for sticky settings headers in layout checks Scroll settings controls into the unobscured area below the measured sticky header, retaining native interaction and hit-testing assertions. Give the full legacy outbox migration fixture a scoped 15-second timeout. Product code and bilingual release notes are unchanged; validation remains in CI. --- .../development/release-preparation-0.15.7.md | 11 +++++++++++ src/main/assistant/assistant-database.test.ts | 2 +- .../workbar-settings-layout-driver.mjs | 19 ++++++++++++++++--- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/docs/development/release-preparation-0.15.7.md b/docs/development/release-preparation-0.15.7.md index 4f8097ea..5049b877 100644 --- a/docs/development/release-preparation-0.15.7.md +++ b/docs/development/release-preparation-0.15.7.md @@ -28,3 +28,14 @@ Story Graph 绑定不经过这些方法,Agent 源码、锁及包未变。边 发布说明保留 schema 52 备份提醒,不修改历史已发布条目。 双远端推送精确候选后,必须通过主分支全量验证与生产构建,并确认候选及双语说明后, 才能创建不可变 `v0.15.7` 标签。 + +## 首轮 CI + +`227507d` 的 Desktop CI `36872224138`:5613 通过、59 跳过、2 失败, +生产构建未执行;Agent CI `36872224140` 通过。 +英文设置布局 fixture 在 640×420 窗口将控件居中到包含固定页头的整个滚动区, +点击检测被较高的英文页头遮挡。测试共用滚动辅助函数改为扣除实际页头高度的 +可见区域,仍检查命中、溢出、文字宽度和原生键盘交互,不改产品布局。 +旧 outbox fixture 先建当前数据库,再降为 schema 23 并执行完整迁移, +超过默认 5 秒;仅该用例设 15 秒,保留终态、尝试次数及附件清理断言。 +修复不修改发布说明或运行时代码,按用户要求继续交新候选 CI 验证。 diff --git a/src/main/assistant/assistant-database.test.ts b/src/main/assistant/assistant-database.test.ts index 39b7c4be..7764293f 100644 --- a/src/main/assistant/assistant-database.test.ts +++ b/src/main/assistant/assistant-database.test.ts @@ -3054,7 +3054,7 @@ describe('AssistantDatabase', () => { ]) expect(terminal[0]?.message).not.toHaveProperty('attachments') migrated.close() - }) + }, 15000) it('rolls back both heartbeat failure updates atomically', async () => { const directory = await mkdtemp( diff --git a/tests/support/workbar-settings-layout-driver.mjs b/tests/support/workbar-settings-layout-driver.mjs index 62be0ef5..c2a0fe69 100644 --- a/tests/support/workbar-settings-layout-driver.mjs +++ b/tests/support/workbar-settings-layout-driver.mjs @@ -28,6 +28,19 @@ app.whenReady().then(async () => { throw new Error(`Timeout: ${code}\n${errors.join('\n')}`) } const settle = () => js('new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(resolve)))') + const scrollSettingsControl = async selector => { + await js(`(() => { + const e=document.querySelector(${JSON.stringify(selector)}); + e.scrollIntoView({block:'center'}); + const pane=e.closest('.settings-panel__content'),p=pane.getBoundingClientRect(); + const header=pane.querySelector('.settings-category-header--sticky'); + const top=Math.max(p.top,header?.getBoundingClientRect().bottom??p.top),bottom=Math.min(p.bottom,innerHeight); + const r=e.getBoundingClientRect(); + if(bottom-top js(`(() => { const e=document.querySelector(${JSON.stringify(selector)});if(!e)throw new Error('Missing control: '+${JSON.stringify(selector)});const r=e.getBoundingClientRect(); return {x:Math.round(r.x+r.width/2),y:Math.round(r.y+r.height/2),hit:e.contains(document.elementFromPoint(r.x+r.width/2,r.y+r.height/2))}; @@ -180,7 +193,7 @@ app.whenReady().then(async () => { await settle() await screenshot(`${locale}-${theme}-settings-overview-${width}`) } - await js("document.querySelector('.model-connection-detail select').scrollIntoView({block:'center'})") + await scrollSettingsControl('.model-connection-detail select') const result = await js(`(() => { const e=document.querySelector('.model-connection-detail select'),s=getComputedStyle(e),r=e.getBoundingClientRect(); const c=document.createElement('canvas').getContext('2d');c.font=s.font; @@ -205,7 +218,7 @@ app.whenReady().then(async () => { observations.push({ locale, theme, width, height, panelWidth, ...result }) await screenshot(`${locale}-${theme}-settings-${width}${panelWidth ? '-narrow-container' : ''}`) const switchSelector = '.model-connection-detail .toggle-row input[role="switch"]' - await js(`document.querySelector(${JSON.stringify(switchSelector)}).scrollIntoView({block:'center'})`) + await scrollSettingsControl(switchSelector) await settle() const switchLayout = await js(`(() => { const input=document.querySelector(${JSON.stringify(switchSelector)}),row=input.closest('.toggle-row'), @@ -222,7 +235,7 @@ app.whenReady().then(async () => { observations.push({ locale, theme, width, height, panelWidth, switchLayout }) if (width === 640 || width === 1280) await screenshot(`${locale}-${theme}-settings-switch-${width}`) if (width === 1280 || width === 640) { - await js("document.querySelector('.model-connection-detail details.settings-section > summary').scrollIntoView({block:'center'})") + await scrollSettingsControl('.model-connection-detail details.settings-section > summary') await click('.model-connection-detail details.settings-section > summary') await wait('document.querySelector(".model-connection-detail details.settings-section").open') const nested = await js(`(() => {