Просмотр исходного кода

fix(15.9): 修复测试文件中 count() 方法参数错误

- Playwright count() 方法不接受 options 参数
- 修改为先等待元素,再检查 count
- 保持清理数据逻辑不变

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
yourname 6 часов назад
Родитель
Сommit
dccc91a4d5

+ 3 - 1
web/tests/e2e/specs/admin/disability-person-id-valid-date-longterm.spec.ts

@@ -57,7 +57,9 @@ test.describe('残疾人管理 - 身份证有效期长期选项测试', () => {
         await disabilityPersonPage.goto().catch(() => {});
         await disabilityPersonPage.searchByName(data.name);
         const deleteButton = page.getByRole('button', { name: '删除' }).first();
-        if (await deleteButton.count({ timeout: TIMEOUTS.VERY_LONG }) > 0) {
+        // 先等待元素可能存在
+        await page.waitForTimeout(500);
+        if (await deleteButton.count() > 0) {
           await deleteButton.click({ timeout: TIMEOUTS.DIALOG });
           await page.getByRole('button', { name: '确认' }).click({ timeout: TIMEOUTS.DIALOG }).catch(() => {});
           await page.waitForTimeout(TIMEOUTS.MEDIUM);