From 929b7ec2a142ebf01775552dec083a7c63ca8e0b Mon Sep 17 00:00:00 2001 From: qiqi Date: Tue, 10 Nov 2026 07:01:02 +0800 Subject: [PATCH] =?UTF-8?q?test(image-annotate):=20=E7=9C=9F=E7=AB=99=20e2?= =?UTF-8?q?e=20=E6=96=AD=E8=A8=80=E6=92=A4=E9=94=80=E7=BB=84=E5=9C=A8?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E6=9D=A1=E6=9C=80=E5=8F=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- image-annotate/tools/e2e-site.mjs | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/image-annotate/tools/e2e-site.mjs b/image-annotate/tools/e2e-site.mjs index 4682289..5de1270 100644 --- a/image-annotate/tools/e2e-site.mjs +++ b/image-annotate/tools/e2e-site.mjs @@ -183,10 +183,24 @@ if (!SKIP_PASTE) { (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)) + // v1.18(用户 2026-11-10):撤销 / 重做 / 还原 从顶栏搬到工具条最右, + // 「适应窗口 / 收起侧栏」退到它前面两位。这里断言「末尾是撤销组、视图按钮在其前」 + // —— 光看版本号挡不住产物没重建。 + const toolsOrder = await page.evaluate(() => { + const kids = Array.from(document.querySelectorAll('.iwb-editor-tools > *')) + const acts = kids.filter((n) => n.dataset && n.dataset.action).map((n) => n.dataset.action) + const hist = kids[kids.length - 1] + return { + tail: acts.slice(-2), + lastIsHistory: Boolean(hist && hist.classList.contains('iwb-editor-history')), + histActs: [...(hist ? hist.querySelectorAll('[data-action]') : [])].map((b) => b.dataset.action), + headerHasHistory: Boolean(document.querySelector('.iwb-editor-header .iwb-editor-history')), + } + }) + check('工具栏最右是「撤销/重做/还原」组(视图按钮在其前)', + JSON.stringify(toolsOrder.tail) === JSON.stringify(['zoomFit', 'togglePanels']) && + toolsOrder.lastIsHistory && toolsOrder.histActs.join(',') === 'undo,redo,reset' && + !toolsOrder.headerHasHistory, JSON.stringify(toolsOrder)) const before = await panelSeq() const activeName = await page.evaluate(() => document.querySelector('.iwb-editor-layer-list .iwb-layer-item.active .iwb-layer-name')?.textContent)