Преглед изворни кода

🐛 fix(e2e): correct element locators in admin login page

- 修改密码显示切换按钮定位方式,使用last()替代nth(1)以提高稳定性
- 更新登录卡片定位选择器,从.card改为.shadow-xl以匹配UI组件变更
yourname пре 2 месеци
родитељ
комит
9d9666c8b0
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      tests/e2e/pages/admin/auth/login.page.ts

+ 2 - 2
tests/e2e/pages/admin/auth/login.page.ts

@@ -22,7 +22,7 @@ export class AdminLoginPage {
     this.usernameInput = page.getByPlaceholder('请输入用户名');
     this.passwordInput = page.getByPlaceholder('请输入密码');
     this.submitButton = page.getByRole('button', { name: '登录' });
-    this.togglePasswordButton = page.locator('button:has(svg)').nth(1);
+    this.togglePasswordButton = page.locator('button:has(svg)').last();
     this.pageTitle = page.getByRole('heading', { name: '管理后台登录' });
     this.welcomeText = page.getByText('请输入您的账号和密码继续操作');
     this.successToast = page.locator('[data-sonner-toast][data-type="success"]');
@@ -32,7 +32,7 @@ export class AdminLoginPage {
     this.testAccountInfo = page.locator('text=测试账号:');
     this.loadingSpinner = page.locator('[aria-busy="true"], .loading-spinner, .spinner');
     this.backgroundElement = page.locator('div.flex.items-center.justify-center').first();
-    this.loginCard = page.locator('.card').first();
+    this.loginCard = page.locator('.shadow-xl').first();
   }
 
   async goto() {