Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(e2e): [time-line] Fixing Test Cases #2407

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

Merged
merged 1 commit into from
Oct 26, 2024
Merged
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
28 changes: 14 additions & 14 deletions examples/sites/demos/pc/app/time-line/status.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,28 @@ test.describe('节点状态', () => {

// 默认状态
await expect(timelineItems.first()).toHaveClass(/process-wait/)
await expect(timelineItems.first().locator('.icon')).toHaveCSS('border-color', 'rgb(87, 93, 108)')
await expect(timelineItems.first().locator('.icon .number')).toHaveCSS('color', 'rgb(87, 93, 108)')
await expect(timelineItems.first().locator('.icon')).toHaveCSS('border-color', 'rgb(219, 219, 219)')
await expect(timelineItems.first().locator('.icon .number')).toHaveCSS('color', 'rgb(128, 128, 128)')

// 成功状态
await expect(timelineItems.nth(1)).toBeVisible()
await expect(timelineItems.nth(1).locator('.icon')).toHaveCSS('border-color', 'rgb(94, 124, 224)')
await expect(timelineItems.nth(1).locator('.icon .icon-yes')).toHaveCSS('fill', 'rgb(94, 124, 224)')
await expect(timelineItems.nth(1).locator('.icon')).toHaveCSS('border-color', 'rgb(25, 25, 25)')
await expect(timelineItems.nth(1).locator('.icon .icon-yes')).toHaveCSS('fill', 'rgb(25, 25, 25)')

// 警告状态
await expect(timelineItems.nth(2).locator('.icon.icon-warning')).toBeVisible()
await expect(timelineItems.nth(2).locator('.icon')).toHaveCSS('background-color', 'rgb(250, 152, 65)')
await expect(timelineItems.nth(2).locator('.icon')).toHaveCSS('background-color', 'rgb(255, 136, 0)')
await expect(timelineItems.nth(2).locator('.icon .icon-warning')).toHaveCSS('fill', 'rgb(255, 255, 255)')

// 异常状态
await expect(timelineItems.nth(3).locator('.icon')).toBeVisible()
await expect(timelineItems.nth(3).locator('.icon')).toHaveCSS('border-color', 'rgb(246, 111, 106)')
await expect(timelineItems.nth(3).locator('.icon .icon-error')).toHaveCSS('fill', 'rgb(222, 80, 78)')
await expect(timelineItems.nth(3).locator('.icon')).toHaveCSS('border-color', 'rgb(242, 48, 48)')
await expect(timelineItems.nth(3).locator('.icon .icon-error')).toHaveCSS('fill', 'rgb(242, 48, 48)')

// 禁用状态
await expect(timelineItems.nth(5)).toHaveClass(/process-disabled/)
await expect(timelineItems.nth(5).locator('.icon')).toHaveCSS('background-color', 'rgb(245, 245, 246)')
await expect(timelineItems.nth(5).locator('.icon .number')).toHaveCSS('color', 'rgb(173, 176, 184)')
await expect(timelineItems.nth(5).locator('.icon')).toHaveCSS('background-color', 'rgb(240, 240, 240)')
await expect(timelineItems.nth(5).locator('.icon .number')).toHaveCSS('color', 'rgb(194, 194, 194)')
})

test('type属性设置节点状态', async ({ page }) => {
Expand All @@ -42,15 +42,15 @@ test.describe('节点状态', () => {
const timelineItems = timeline.locator('.tiny-timeline-item')

await expect(timelineItems.first()).toHaveClass(/timeline-item--primary/)
await expect(timelineItems.first().locator('.dot')).toHaveCSS('background-color', 'rgb(223, 225, 230)')
await expect(timelineItems.first().locator('.dot')).toHaveCSS('background-color', 'rgb(194, 194, 194)')
await expect(timelineItems.nth(1)).toHaveClass(/timeline-item--success/)
await expect(timelineItems.nth(1).locator('.dot')).toHaveCSS('background-color', 'rgb(80, 212, 171)')
await expect(timelineItems.nth(1).locator('.dot')).toHaveCSS('background-color', 'rgb(92, 179, 0)')

await expect(timelineItems.nth(2)).toHaveClass(/timeline-item--warning/)
await expect(timelineItems.nth(2).locator('.dot')).toHaveCSS('background-color', 'rgb(250, 152, 65)')
await expect(timelineItems.nth(2).locator('.dot')).toHaveCSS('background-color', 'rgb(255, 136, 0)')
await expect(timelineItems.nth(3)).toHaveClass(/timeline-item--danger/)
await expect(timelineItems.nth(3).locator('.dot')).toHaveCSS('background-color', 'rgb(246, 111, 106)')
await expect(timelineItems.nth(3).locator('.dot')).toHaveCSS('background-color', 'rgb(242, 48, 48)')
await expect(timelineItems.nth(4)).toHaveClass(/timeline-item--info/)
await expect(timelineItems.nth(4).locator('.dot')).toHaveCSS('background-color', 'rgb(94, 124, 224)')
await expect(timelineItems.nth(4).locator('.dot')).toHaveCSS('background-color', 'rgb(20, 118, 255)')
})
})
Loading