优化(07-28-all-account-login-readiness): 调整密码框Tab顺序
ci-e2e / e2e (push) Canceled after 0s
ci-minimal / check-minimal (push) Canceled after 0s

这个提交包含在:
2026-08-23 19:10:34 +08:00
父节点 e7b516ed3e
当前提交 7b86ffb3c9
共修改 8 个文件,包含 149 行新增和 21 行删除
+18 -2
查看文件
@@ -381,9 +381,18 @@ test("登录页提供找回密码、密码显隐,PWA 更新不会清空正在
await page.keyboard.press("Tab");
await expect(page.getByTestId("login-password")).toBeFocused();
await page.getByTestId("login-password").fill("PasswordA1234");
await page.getByTestId("login-password").focus();
await page.keyboard.press("Tab");
await expect(page.getByRole("link", { name: "忘记密码?" })).toBeFocused();
await expect(page.getByTestId("login-password")).toHaveAttribute("type", "password");
await page.getByRole("button", { name: "显示密码" }).click();
const passwordToggle = page.locator('button[aria-controls="login-password"]');
await expect(passwordToggle).toHaveAttribute("aria-label", "显示密码");
await expect(passwordToggle).toHaveAttribute("aria-pressed", "false");
await expect(passwordToggle).toHaveAttribute("tabindex", "-1");
await passwordToggle.click();
await expect(passwordToggle).toHaveAttribute("aria-label", "隐藏密码");
await expect(passwordToggle).toHaveAttribute("aria-pressed", "true");
await expect(page.getByTestId("login-password")).toHaveAttribute("type", "text");
await expect(page.getByTestId("login-identifier")).toHaveValue("[email protected]");
await expect(page.getByTestId("login-password")).toHaveValue("PasswordA1234");
@@ -519,11 +528,18 @@ test("找回密码流程使用邮箱验证码重置新密码", async ({ page })
await page.getByTestId("forgot-password-new").fill("NewPassword1234");
await page.getByTestId("forgot-password-confirm").fill("NewPassword1234");
await page.getByTestId("forgot-password-new").focus();
await page.keyboard.press("Tab");
await expect(page.getByTestId("forgot-password-confirm")).toBeFocused();
await page.keyboard.press("Tab");
await expect(page.getByTestId("forgot-password-submit")).toBeFocused();
await page.getByRole("button", { name: "显示密码" }).first().click();
await expect(page.getByTestId("forgot-password-new")).toHaveAttribute("type", "text");
await expect(page.getByTestId("forgot-password-new")).toHaveValue("NewPassword1234");
await page.getByTestId("forgot-password-submit").click();
await page.getByTestId("forgot-password-confirm").focus();
await page.keyboard.press("Enter");
await expect(page).toHaveURL(/\/login$/);
expect(resetPayloads).toEqual([
+9
查看文件
@@ -417,6 +417,15 @@ test("E2E 首次登录:一次性口令登录后强制改密", async ({ page })
await page.getByTestId("change-password-old").fill("ResetA1abc123def456");
await page.getByTestId("change-password-new").fill("NewPassword1234");
await page.getByLabel("确认新密码").fill("NewPassword1234");
await page.getByTestId("change-password-old").focus();
await page.keyboard.press("Tab");
await expect(page.getByTestId("change-password-new")).toBeFocused();
await page.keyboard.press("Tab");
await expect(page.getByLabel("确认新密码")).toBeFocused();
await page.keyboard.press("Tab");
await expect(page.getByTestId("change-password-submit")).toBeFocused();
await page.getByTestId("change-password-submit").click();
expect(changePasswordPayload).toEqual({