补齐固定旧版的浏览器逐笔写入对照并记录账务差异

This commit is contained in:
黄健铭 committed 2026-12-05 02:33:01 -08:00
1 parent e77588b337
commit 7d2007955f
39 files changed
+3653 -41

No files matched your search

@@ -0,0 +1,27 @@
import assert from 'node:assert/strict';
export async function section(page, ctx, key) {
if (ctx.version === 'new') await page.goto(ctx.base + '/next/' + key);
else {
await page.goto(ctx.base + '/');
await page
.locator('nav button[data-tab="' + key + '"]:visible')
.first()
.click();
}
}
export function action(scope, name) {
return scope.locator('[data-action="' + name + '"]:visible').first();
}
export async function postFrom(page, url, click, expectedStatus = 200) {
const [response] = await Promise.all([
page.waitForResponse(r => new URL(r.url()).pathname === url && r.request().method() === 'POST'),
click(),
]);
const result = await response.json();
assert.equal(response.status(), expectedStatus, url + ' ' + JSON.stringify(result));
await page.waitForLoadState('networkidle');
return result;
}