guanghu/e2e/find-selectors.spec.ts
冰朔 8739805f99
Some checks failed
Auto-update PR branches / Update open PR branches (push) Has been cancelled
CI / Frontend Static Quality Checks (push) Has been cancelled
CI / Frontend Tests & Coverage (push) Has been cancelled
CI / Rust Tests & Quality Checks (push) Has been cancelled
CI / Linux build verification (push) Has been cancelled
Release (Alpha) / Compute alpha version (push) Has been cancelled
Release (Alpha) / Build release artifacts (push) Has been cancelled
Release (Alpha) / GitHub Release (alpha) (push) Has been cancelled
Release (Alpha) / Update docs and release pages (push) Has been cancelled
Deploy docs / Build VitePress site (push) Has been cancelled
Deploy docs / Deploy to GitHub Pages (push) Has been cancelled
光湖开源源码快照 · Tolaria AGPL 分叉基线 · 独立更新链
2026-07-05 17:45:16 +08:00

20 lines
687 B
TypeScript

import { test } from '@playwright/test'
test('find note selectors', async ({ page }) => {
await page.setViewportSize({ width: 1440, height: 900 })
await page.goto('/', { waitUntil: 'networkidle' })
await page.waitForTimeout(3000)
// Get all clickable elements with their text
const info = await page.evaluate(() => {
const items = document.querySelectorAll('[class*="cursor-pointer"]')
return Array.from(items).slice(0, 20).map(el => ({
tag: el.tagName,
text: el.textContent?.trim().slice(0, 50),
cls: el.className.toString().slice(0, 80),
rect: el.getBoundingClientRect().toJSON()
}))
})
console.log(JSON.stringify(info, null, 2))
})