AvanzaCast/e2e/puppeteer-runner/debug-list-elements.js
Cesar Mendivil 8b458a3ddf feat: add initial LiveKit Meet integration with utility scripts, configs, and core components
- Add Next.js app structure with base configs, linting, and formatting
- Implement LiveKit Meet page, types, and utility functions
- Add Docker, Compose, and deployment scripts for backend and token server
- Provide E2E and smoke test scaffolding with Puppeteer and Playwright helpers
- Include CSS modules and global styles for UI
- Add postMessage and studio integration utilities
- Update package.json with dependencies and scripts for development and testing
2025-11-20 12:50:38 -07:00

28 lines
1.4 KiB
JavaScript

const puppeteer = require('puppeteer')
const dotenv = require('dotenv')
dotenv.config()
async function run(ws, url) {
console.log('connecting to', ws)
const browser = await puppeteer.connect({ browserWSEndpoint: ws, defaultViewport: { width: 1400, height: 900 } })
const page = await browser.newPage()
page.on('console', msg => console.log('PAGE LOG:', msg.text()))
await page.goto(url, { waitUntil: 'networkidle2', timeout: 30000 })
await page.waitForTimeout(1500)
const results = await page.evaluate(() => {
function normalize(s){ return (s||'').replace(/\s+/g,' ').trim() }
const nodes = Array.from(document.querySelectorAll('button,a,div[role="button"],input[type="button"]'))
return nodes.slice(0,100).map(n => ({ tag: n.tagName, text: normalize(n.textContent||n.innerText||''), classes: n.className, role: n.getAttribute('role') || null, visible: (()=>{ const r=n.getBoundingClientRect(); return !!(r.width && r.height) })() }))
})
console.log('Found elements count:', results.length)
for (const r of results) console.log(JSON.stringify(r))
await browser.close()
}
const WS = process.env.BROWSERLESS_WS || process.argv[2]
const URL = process.env.VITE_BROADCASTPANEL_URL || process.argv[3] || 'https://avanzacast-broadcastpanel.bfzqqk.easypanel.host'
if (!WS) { console.error('Need ws endpoint'); process.exit(2) }
run(WS, URL).catch(e => { console.error(e && e.stack ? e.stack : e); process.exit(3) })