Skip to content

Commit

Permalink
fix(cascader): fix e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
shenjunjian committed Oct 21, 2024
1 parent 58e4e72 commit b3acee2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test('动态加载且父子级不相关联 lazyload & checkStrictly', async ({ p
const loadingSvg = page.getByRole('menuitem', { name: '选项1' }).locator('svg')
await expect(loadingSvg).toHaveClass(/tiny-cascader-node__postfix/)
await page.waitForTimeout(100)
await page.getByRole('menuitem', { name: '选项2' }).getByRole('radio').click()
await page.getByRole('menuitem', { name: '选项2' }).getByRole('radio').nth(0).click()
await page.getByRole('textbox', { name: '请选择' }).click()
const light = page.getByRole('menuitem', { name: '选项2' }).getByRole('radio')
await expect(light).toHaveClass('tiny-radio is-checked')
Expand Down
4 changes: 2 additions & 2 deletions examples/sites/demos/pc/app/cascader/check-strictly.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ test('父子级不相关联', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('cascader#check-strictly')
await page.getByRole('textbox', { name: '请选择' }).click()
await page.getByRole('menuitem', { name: '开发' }).getByRole('radio').click()
await page.getByRole('menuitem', { name: '开发' }).getByRole('radio').nth(0).click()
await page.getByRole('textbox', { name: '请选择' }).click()
const light = page.getByRole('menuitem', { name: '开发' }).getByRole('radio')
await expect(light).toHaveClass('tiny-radio is-checked')
await expect(light).nth(0).toHaveClass('tiny-radio is-checked')
})

0 comments on commit b3acee2

Please sign in to comment.