Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(test): [cascader, notify] update e2e test #1445

Merged
merged 1 commit into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ test('动态加载且父子级不相关联 lazyload & checkStrictly', async ({ p
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('cascader#auto-load-checkStrictly')
await page.locator('.tiny-cascader').click()
const svg = page.locator('.tiny-cascader-node__postfix > .st0')
const svg = page.locator('.tiny-cascader-node__postfix > path')
await expect(svg).toBeVisible()
await page.locator('li[role="menuitem"]').click()
const loadingSvg = page.getByRole('menuitem', { name: '选项1' }).locator('path')
Expand Down
7 changes: 5 additions & 2 deletions examples/sites/demos/pc/app/cascader/auto-load.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ test('动态加载 lazyload', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('cascader#auto-load')
await page.getByRole('textbox', { name: '请选择' }).click()
const svg = page.locator('.tiny-cascader-node__postfix > .st0')
await expect(svg).toHaveAttribute('d', 'M7 21c.2 0 .5-.1.6-.2l9.9-8c.2-.2.4-.5.4-.8 0-.3-.1-.6-.4-.8L7.6 3.3c-.4-.4-1.1-.3-1.4.2-.4.4-.3 1.1.2 1.4l8.9 7.2-8.9 7.2c-.4.4-.5 1-.2 1.4.2.2.5.3.8.3z')
const svg = page.locator('.tiny-cascader-node__postfix > path')
await expect(svg).toHaveAttribute(
'd',
'M7 21c.2 0 .5-.1.6-.2l9.9-8c.2-.2.4-.5.4-.8 0-.3-.1-.6-.4-.8L7.6 3.3c-.4-.4-1.1-.3-1.4.2-.4.4-.3 1.1.2 1.4l8.9 7.2-8.9 7.2c-.4.4-.5 1-.2 1.4.2.2.5.3.8.3z'
)
await page.getByRole('menuitem', { name: '选项1' }).click()
const loadingSvg = page.getByRole('menuitem', { name: '选项1' }).locator('path')
await expect(loadingSvg).toHaveAttribute(
Expand Down
2 changes: 1 addition & 1 deletion examples/sites/demos/pc/app/notify/closeIcon.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ test('自定义关闭图标', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('notify#closeIcon')
await page.getByRole('button', { name: '自定义关闭图标' }).click()
const svg = page.locator('.tiny-notify__icon-close > .tiny-svg > .st0')
const svg = page.locator('.tiny-notify__icon-close > .tiny-svg > path')
await expect(svg).toHaveAttribute(
'd',
'M3 1h18c.9 0 2 1.1 2 2v18c0 .9-1 2-2 2H3c-.9 0-2-1.1-2-2V3c0-.9 1.1-2 2-2zm0 2v18h18V3H3zm13.8 4.2c.3.3.3.9 0 1.2L13.2 12l3.6 3.6c.3.3.3.9 0 1.2-.2.2-.4.2-.6.2-.2 0-.4-.1-.6-.2L12 13.2l-3.6 3.6c-.1.1-.4.2-.6.2s-.4-.1-.6-.2c-.3-.3-.3-.9 0-1.2l3.6-3.6-3.6-3.6c-.3-.3-.3-.9 0-1.2.3-.3.9-.3 1.2 0l3.6 3.6 3.6-3.6c.3-.3.8-.3 1.2 0z'
Expand Down
Loading