From bf32ec6ddb95c5b5f36c8321a0eaea944902d4b7 Mon Sep 17 00:00:00 2001 From: qiqi Date: Sun, 8 Nov 2026 22:29:45 +0800 Subject: [PATCH] =?UTF-8?q?test(image-annotate):=20=E7=9C=9F=E7=AB=99=20e2?= =?UTF-8?q?e=20=E8=B7=9F=E4=B8=8A=20v1.13=20=E6=94=B9=E5=8A=A8=EF=BC=88?= =?UTF-8?q?=E5=B1=82=E7=BA=A7=E6=8C=89=E9=92=AE=E5=88=A0=E9=99=A4=20/=20?= =?UTF-8?q?=E8=A7=86=E5=9B=BE=E6=8C=89=E9=92=AE=E5=BD=92=E4=BD=8D=20/=20?= =?UTF-8?q?=E5=BF=AB=E6=8D=B7=E9=94=AE=E6=8E=92=E5=BA=8F=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 原 4.6 段还在点 `.iwb-editor-layer-btn[data-layer=down]`,按钮已删会一直等到 30s 超时。 改为:断言顶栏层级按钮数为 0、工具栏末两个子元素是 zoomFit/togglePanels, 排序部分改用 Ctrl+[ / Ctrl+] / Ctrl+Shift+[ / Ctrl+Shift+] 验证, 并新增一条「置底后原图不再被钉在最底」—— 实测输出 矩形 > 原图 > 图层 2, 即被置底的那层压到了原图下面,解封生效。 真站 e2e 全通过(含 SRI / CSP 段)。 --- image-annotate/tools/e2e-site.mjs | 34 +++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/image-annotate/tools/e2e-site.mjs b/image-annotate/tools/e2e-site.mjs index f3d47ba..f72e3c4 100644 --- a/image-annotate/tools/e2e-site.mjs +++ b/image-annotate/tools/e2e-site.mjs @@ -176,18 +176,34 @@ if (!SKIP_PASTE) { check('点击「截图+图形」重叠区选中最上层截图(不被下方图形抢走)', Boolean(activeItem && activeItem.type === 'bitmap' && /图层/.test(activeItem.name)), JSON.stringify(activeItem)) + // v1.13 起顶栏四个层级按钮已删除(改为图层拖动 + Ctrl+]/[ 快捷键), + // 这里改为断言「按钮确实没了」+ 用快捷键验证排序仍然可用。 + check('顶栏不再有层级排序按钮(改用图层拖动 + Ctrl+]/[)', + (await page.locator('.iwb-editor-layer-btn').count()) === 0 && + (await page.locator('.iwb-editor-header .iwb-editor-commands').count()) === 0, + 'layerBtn=' + await page.locator('.iwb-editor-layer-btn').count()) + + const toolsTail = await page.evaluate(() => Array.from(document.querySelectorAll('.iwb-editor-tools > *')) + .slice(-2).map((n) => n.dataset.action || n.className)) + check('工具栏最右两个按钮是「适应窗口 / 收起侧栏」', + JSON.stringify(toolsTail) === JSON.stringify(['zoomFit', 'togglePanels']), JSON.stringify(toolsTail)) + const before = await panelSeq() - await page.locator('.iwb-editor-layer-btn[data-layer="down"]').click() + const activeName = await page.evaluate(() => document.querySelector('.iwb-editor-layer-list .iwb-layer-item.active .iwb-layer-name')?.textContent) + await page.keyboard.press('Control+[') // 下移一层 const afterDown = await panelSeq() - check('「下移一层」改变图层顺序', before !== afterDown, before + ' → ' + afterDown) - await page.locator('.iwb-editor-layer-btn[data-layer="up"]').click() - check('「上移一层」恢复原顺序', (await panelSeq()) === before, await panelSeq()) - await page.locator('.iwb-editor-layer-btn[data-layer="bottom"]').click() + check('Ctrl+[ 下移一层改变图层顺序', before !== afterDown, before + ' → ' + afterDown) + await page.keyboard.press('Control+]') // 上移一层 + check('Ctrl+] 上移一层恢复原顺序', (await panelSeq()) === before, await panelSeq()) + + await page.keyboard.press('Control+Shift+[') // 置底 const afterBottom = await panelSeq() - check('「置底」生效且原图仍在最底(元素不会消失)', - afterBottom !== before && afterBottom.endsWith('原图'), afterBottom) - await page.locator('.iwb-editor-layer-btn[data-layer="top"]').click() - check('「置顶」生效', (await panelSeq()) !== afterBottom, await panelSeq()) + check('Ctrl+Shift+[ 置底生效(元素不会消失)', + afterBottom !== before && afterBottom.endsWith(String(activeName)), afterBottom) + check('置底后原图不再被钉在最底 —— 图层可以压到原图下面(v1.13 解封)', + !afterBottom.endsWith('原图'), afterBottom) + await page.keyboard.press('Control+Shift+]') // 置顶 + check('Ctrl+Shift+] 置顶生效', (await panelSeq()) !== afterBottom, await panelSeq()) check('排序后仍只有一个选中项', (await activeCount()) === 1, 'active=' + await activeCount()) // 复原成画笔工具,避免影响后面「覆盖」链路的画笔取样