Skip to content

Commit b563ad1

Browse files
committed
test(dropdown): [action-menu,dropdown] synchronize modification of test cases
1 parent a5326e8 commit b563ad1

File tree

2 files changed

+19
-18
lines changed

2 files changed

+19
-18
lines changed

examples/sites/demos/pc/app/action-menu/popper-class.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ test('弹框样式', async ({ page }) => {
1313
await visibleItem.last().hover()
1414
await page.waitForTimeout(200)
1515
await expect(dropDownMenu).toHaveClass(/custom-action-menu/)
16-
await expect(dropDownMenu).toHaveCSS('background-color', 'rgb(250, 235, 215)')
16+
await expect(dropDownMenu).toHaveCSS('background-color', 'rgb(255, 255, 255)')
1717
})
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
import { test, expect } from '@playwright/test'
22

3+
// 不展示此示例。按钮类型推荐使用 border
34
test('按钮类型', async ({ page }) => {
45
page.on('pageerror', (exception) => expect(exception).toBeNull())
5-
await page.goto('dropdown#split-button')
6+
// await page.goto('dropdown#split-button')
67

7-
const wrap = page.locator('#split-button')
8-
const dropDown = wrap.locator('.tiny-dropdown').nth(1)
9-
const dropDownMenu = page.locator('body > .tiny-dropdown-menu')
10-
const textBtn = dropDown.locator('button').first()
11-
const dropDownBtn = dropDown.locator('button').nth(1)
8+
// const wrap = page.locator('#split-button')
9+
// const dropDown = wrap.locator('.tiny-dropdown').nth(1)
10+
// const dropDownMenu = page.locator('body > .tiny-dropdown-menu')
11+
// const textBtn = dropDown.locator('button').first()
12+
// const dropDownBtn = dropDown.locator('button').nth(1)
1213

1314
// 是否变成了按钮且按钮样式是否生效
14-
await expect(dropDown.locator('button')).toHaveCount(2)
15-
await expect(textBtn).toHaveCSS('background-color', 'rgb(92, 179, 0)')
16-
await expect(textBtn).toHaveCSS('color', 'rgb(255, 255, 255)')
17-
await expect(dropDownBtn).toHaveCSS('background-color', 'rgb(92, 179, 0)')
18-
await expect(dropDownBtn).toHaveCSS('color', 'rgb(255, 255, 255)')
15+
// await expect(dropDown.locator('button')).toHaveCount(2)
16+
// await expect(textBtn).toHaveCSS('background-color', 'rgb(92, 179, 0)')
17+
// await expect(textBtn).toHaveCSS('color', 'rgb(255, 255, 255)')
18+
// await expect(dropDownBtn).toHaveCSS('background-color', 'rgb(92, 179, 0)')
19+
// await expect(dropDownBtn).toHaveCSS('color', 'rgb(255, 255, 255)')
1920

20-
// 文字悬浮不出现下拉菜单
21-
await page.waitForTimeout(500)
22-
await textBtn.hover()
23-
await expect(dropDownMenu).not.toBeVisible()
24-
await dropDownBtn.hover()
25-
await expect(dropDownMenu).toBeVisible()
21+
// // 文字悬浮不出现下拉菜单
22+
// await page.waitForTimeout(500)
23+
// await textBtn.hover()
24+
// await expect(dropDownMenu).not.toBeVisible()
25+
// await dropDownBtn.hover()
26+
// await expect(dropDownMenu).toBeVisible()
2627
})

0 commit comments

Comments
 (0)