A1-A7 收口OA统一审批中心与企微基础设施路线
这个提交包含在:
@@ -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");
|
||||
|
||||
在新工单中引用
屏蔽一个用户