tiny-vue/examples/docs/resources/pc/demo/tree/highlight-current.spec.ts

10 lines
465 B
TypeScript

import { test, expect } from '@playwright/test'
test('高亮当前选中节点', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('http://localhost:7130/pc/tree/highlight-current')
const node = page.getByRole('treeitem', { name: '三级 1-1-1' }).locator('.tiny-tree-node__content')
await node.click()
await expect(page.locator('#preview .tiny-tree')).toHaveClass(/tiny-tree--highlight-current/)
})