From 340100ce6c93fc574084315176e2268d253b00c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=81=A5=E9=93=AD?= Date: Sat, 5 Dec 2026 02:34:07 -0800 Subject: [PATCH] =?UTF-8?q?=E7=AD=89=E5=91=98=E5=B7=A5=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=AE=8C=E6=88=90=E5=90=8E=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E5=BA=97=E9=93=BA=E4=BF=9D=E5=AD=98=E5=B9=B6=E5=9B=BA=E5=AE=9A?= =?UTF-8?q?=E8=BF=90=E8=A1=8C=E8=B5=B7=E5=A7=8B=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 新账系统/e2e/parity-writes.mjs | 5 +++-- 新账系统/e2e/writes/settings.mjs | 8 +++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/新账系统/e2e/parity-writes.mjs b/新账系统/e2e/parity-writes.mjs index 564cd8e..936e405 100644 --- a/新账系统/e2e/parity-writes.mjs +++ b/新账系统/e2e/parity-writes.mjs @@ -16,6 +16,7 @@ import { compare, report } from './lib/diff.js'; import { app, git, reference, fixedReference } from './lib/write-reference.mjs'; +const candidate = git('rev-parse', 'HEAD'); const temp = fs.mkdtempSync(path.join(os.tmpdir(), 'ledger-write-parity-')); let oldApp; const day = '2026-11-20'; @@ -306,7 +307,7 @@ try { : process.argv[only + 1].split(','); const allHits = {}, outcomes = {}; - console.log('旧版', reference, '新版', git('rev-parse', 'HEAD')); + console.log('旧版', reference, '新版', candidate); process.env.WEB_NEXT = '1'; browser = await chromium.launch(); for (const group of groups) { @@ -377,7 +378,7 @@ try { const name = only < 0 ? 'all' : groups.join('-') + (process.argv.includes('--prove') ? '-negative' : ''); fs.writeFileSync( path.join(output, name + '.json'), - redact(JSON.stringify({ reference, head: git('rev-parse', 'HEAD'), outcomes, coverage: routes }, null, 2)), + redact(JSON.stringify({ reference, head: candidate, outcomes, coverage: routes }, null, 2)), ); } finally { await browser?.close(); diff --git a/新账系统/e2e/writes/settings.mjs b/新账系统/e2e/writes/settings.mjs index 260fc75..d229e6b 100644 --- a/新账系统/e2e/writes/settings.mjs +++ b/新账系统/e2e/writes/settings.mjs @@ -49,11 +49,17 @@ export default async function settings(ctx) { await form.locator('[name=verified]').check(); await write(ctx, owner, title + '员工', endpoint + verb, () => submit(form)); } + // 旧界面先关闭员工弹窗,再更新店铺表单并重载员工列表。 + await row.waitFor({ state: 'detached' }); + await owner.locator('[data-employee="owner"]').waitFor(); const shop = owner.locator('#shop-settings-form'), print = owner.locator('#print-settings'); await fill(shop, { storeName: '迁移对照店铺' }); await fill(print, { rows: '8' }); - await write(ctx, owner, '保存店铺名称', '/api/shop-settings', () => submit(shop)); + await write(ctx, owner, '保存店铺名称', '/api/shop-settings', async () => { + assert.equal(await shop.locator('[name=storeName]').inputValue(), '迁移对照店铺'); + await submit(shop); + }); assert.equal(await print.locator('[name=rows]').inputValue(), '8'); await write(ctx, owner, '保存打印设置', '/api/printing', () => owner.locator('button[form=print-settings]').click()); await ctx.step('备份并下载完整账本', async () => {