tiny-vue/examples/sites/demos/pc/app/toggle-menu/node-click.spec.ts

13 lines
827 B
TypeScript

import { test, expect } from '@playwright/test'
test('点击节点事件', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('toggle-menu#node-click')
await page.getByRole('treeitem', { name: '更新日志' }).locator('div').nth(1).click()
await expect(page.locator('.tiny-modal__box').filter({ hasText: '点击节点后的事件' })).toBeVisible()
await page.getByRole('treeitem', { name: '开发指南' }).locator('div').nth(1).click()
await expect(page.locator('.tiny-modal__box').filter({ hasText: '点击节点后的事件' }).nth(1)).toBeVisible()
await page.getByRole('treeitem', { name: '权限' }).locator('div').nth(1).click()
await expect(page.locator('.tiny-modal__box').filter({ hasText: '点击节点后的事件' }).nth(2)).toBeVisible()
})