From c6783e2b7cd8fca5c42f41217275c36fec4f98dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=B3=E5=90=9B=E5=81=A5?= <40288193@qq.com> Date: Thu, 23 Jul 2026 14:41:28 +0800 Subject: [PATCH] fix: fix e2e errors of dialog-select and modal (#4256) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: fix dialog-select e2e error * fix: 修改model-event e2e测试 * fix: 还原文件 --- .../sites/demos/pc/app/dialog-select/set-selection.spec.ts | 3 ++- examples/sites/demos/pc/app/modal/modal-event.spec.ts | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/sites/demos/pc/app/dialog-select/set-selection.spec.ts b/examples/sites/demos/pc/app/dialog-select/set-selection.spec.ts index 8f0285906..644864688 100644 --- a/examples/sites/demos/pc/app/dialog-select/set-selection.spec.ts +++ b/examples/sites/demos/pc/app/dialog-select/set-selection.spec.ts @@ -11,7 +11,8 @@ test('dialogSelect 设置多选状态', async ({ page }) => { const trs = await page.locator('.tiny-grid table tbody tr').all() for (let i = 0; i < trs.length; i++) { const classes = await trs[i].getAttribute('class') - if (i === 1) { + // 第1行,2行都选被中 + if (i === 0 || i === 1) { expect(classes?.includes('row__selected')).toBeTruthy() } else { expect(classes?.includes('row__selected')).toBeFalsy() diff --git a/examples/sites/demos/pc/app/modal/modal-event.spec.ts b/examples/sites/demos/pc/app/modal/modal-event.spec.ts index 9e1231952..b2460142f 100644 --- a/examples/sites/demos/pc/app/modal/modal-event.spec.ts +++ b/examples/sites/demos/pc/app/modal/modal-event.spec.ts @@ -10,6 +10,6 @@ test('弹窗的事件', async ({ page }) => { await expect(content.nth(1)).toHaveText(/cancel 事件触发了/) await page.getByRole('button', { name: '打开带事件弹窗' }).nth(1).click() await page.getByRole('button', { name: '确定' }).click() - await expect(content.nth(2)).toHaveText(/hide 事件触发了/) - await expect(content.nth(2)).toHaveText(/confirm 事件触发了/) + await expect(content.filter({ hasText: /hide 事件触发了/ })).toBeVisible() + await expect(content.filter({ hasText: /confirm 事件触发了/ })).toBeVisible() })