A1-A7 收口OA统一审批中心与企微基础设施路线

这个提交包含在:
2026-05-09 15:28:39 +08:00
父节点 37c717110b
当前提交 8110e7df9c
共修改 10 个文件,包含 103 行新增和 32 行删除
@@ -19,10 +19,24 @@ async function login(page: Page, user: E2EUser) {
await page.goto("/login");
const credentialForm = page.locator("#login-identifier, input[autocomplete='username'], input[placeholder*='邮箱']").first();
const accountLoginButton = page.getByRole("button", { name: "使用账号密码登录" });
const credentialFormVisible = await credentialForm.isVisible({ timeout: 1_000 }).catch(() => false);
const accountLoginVisible = await accountLoginButton.isVisible().catch(() => false);
if (!credentialFormVisible && accountLoginVisible) {
await accountLoginButton.click({ timeout: 5_000 });
for (let attempt = 0; attempt < 3; attempt += 1) {
const credentialFormVisible = await credentialForm.isVisible({ timeout: 1_000 }).catch(() => false);
if (credentialFormVisible) {
break;
}
const accountLoginVisible = await accountLoginButton.isVisible({ timeout: 3_000 }).catch(() => false);
if (!accountLoginVisible) {
break;
}
try {
await accountLoginButton.click({ timeout: 5_000 });
} catch (error) {
if (attempt >= 2) {
throw error;
}
}
}
const identifierByTestId = page.getByTestId("login-identifier");