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() })