Pārlūkot izejas kodu

✨ feat(tests): 更新残疾人管理页面测试路径和选择器

- 将导航路径从 `/admin/disability-persons` 更新为 `/admin/disabilities`
- 将表单选择器从 `form#-create-form` 修正为 `form#create-form`
- 将省份和城市选择器从自定义 `data-testid` 属性更新为标准 `name` 属性选择器
yourname 1 nedēļu atpakaļ
vecāks
revīzija
cc60e0c9f4
1 mainītis faili ar 5 papildinājumiem un 5 dzēšanām
  1. 5 5
      web/tests/e2e/pages/admin/disability-person.page.ts

+ 5 - 5
web/tests/e2e/pages/admin/disability-person.page.ts

@@ -18,7 +18,7 @@ export class DisabilityPersonManagementPage {
   }
 
   async goto() {
-    await this.page.goto('/admin/disability-persons');
+    await this.page.goto('/admin/disabilities');
     await this.page.waitForLoadState('domcontentloaded');
     await this.page.waitForSelector('h1:has-text("残疾人个人管理")', { state: 'visible', timeout: 15000 });
     await this.page.waitForSelector('table tbody tr', { state: 'visible', timeout: 20000 });
@@ -70,8 +70,8 @@ export class DisabilityPersonManagementPage {
     province: string;
     city: string;
   }) {
-    // 等待表单出现
-    await this.page.waitForSelector('form#-create-form', { state: 'visible', timeout: 5000 });
+    // 等待表单出现 - 使用正确的 form ID
+    await this.page.waitForSelector('form#create-form', { state: 'visible', timeout: 5000 });
 
     // 填写基本信息
     await this.page.getByLabel('姓名 *').fill(data.name);
@@ -84,9 +84,9 @@ export class DisabilityPersonManagementPage {
     await this.page.getByLabel('身份证地址 *').fill(data.idAddress);
 
     // 居住地址 - 使用省份选择
-    await this.page.locator('[data-testid="province-select"]').selectOption(data.province);
+    await this.page.locator('select[name="province"]').selectOption(data.province);
     await this.page.waitForTimeout(500); // 等待城市加载
-    await this.page.locator('[data-testid="city-select"]').selectOption(data.city);
+    await this.page.locator('select[name="city"]').selectOption(data.city);
   }
 
   async submitForm() {