tiny-vue_version0/examples/sites/demos/pc/app/link/focus-no-underline.spec.ts

14 lines
569 B
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { test, expect } from '@playwright/test'
test('聚焦时有无下划线', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('link#focus-no-underline')
const demo = page.locator('#focus-no-underline')
let anchor = demo.locator('a').filter({ hasText: '无下划线' })
await anchor.hover()
await expect(anchor).toHaveCSS('text-decoration', /none/)
// 无法获取到伪元素::after暂时跳过测试
anchor = demo.locator('a').filter({ hasText: '有下划线' })
await anchor.hover()
})