修复授权分页并补齐追回到账诊断验证(09-17-company-loan-principal-repayment)

这个提交包含在:
2026-10-10 21:56:08 +08:00
父节点 db919dc6f6
当前提交 91fe31f0db
共修改 14 个文件,包含 623 行新增和 25 行删除
+8 -4
查看文件
@@ -157,11 +157,15 @@ module.exports = async function employeeBrowser(h) {
await page.getByRole('button', { name: '登记公司代表授权范围', exact: true }).click();
dialog = page.getByRole('dialog');
await expect(dialog.getByLabel('授权出借人').locator('option').nth(1)).toBeAttached();
// D1: a response arriving is not the page being rendered. Step only after
// the option list has loaded a different page (also covers cache hits).
const lenderOptions = () => dialog.getByLabel('授权出借人').locator('option').evaluateAll(os => os.map(o => o.value).join(','));
for (let i = 0; !(await dialog.getByLabel('授权出借人').locator(`option[value="${lender.id}"]`).count()); i++) {
assert.ok(i < 20);
// Await both together so a timeout reaches the catch below (and its screenshot).
await Promise.all([page.waitForResponse(r => r.url().includes('/loan-lenders?page=')),
dialog.getByRole('button', { name: '下一页出借人', exact: true }).click({ timeout: 30000 })]);
assert.ok(i < 20, 'authorized lender not found on any page');
const before = await lenderOptions();
const next = dialog.getByRole('button', { name: '下一页出借人', exact: true });
await expect(next).toBeEnabled({ timeout: 10000 }); await next.click();
await expect.poll(async () => { const now = await lenderOptions(); return now.split(',').length > 1 && now !== before; }, { timeout: 15000 }).toBe(true);
}
await dialog.getByLabel('授权出借人').selectOption(lender.id);
await dialog.getByRole('checkbox', { name: new RegExp(loan.loan_no) }).check();