mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-24 22:04:56 +00:00
19 lines
630 B
TypeScript
19 lines
630 B
TypeScript
import { test } from '@playwright/test'
|
|
|
|
const GATEWAY = 'http://localhost'
|
|
|
|
test('debug errors page', async ({ page }) => {
|
|
const errors: string[] = []
|
|
page.on('console', msg => {
|
|
if (msg.type() === 'error') errors.push(msg.text())
|
|
})
|
|
|
|
await page.goto(`${GATEWAY}/codegen/persistence`, { waitUntil: 'networkidle', timeout: 30000 })
|
|
await page.waitForTimeout(2000)
|
|
await page.screenshot({ path: '/tmp/errors-page.png' })
|
|
|
|
const main = await page.evaluate(() => document.querySelector('main')?.innerHTML ?? 'NO MAIN')
|
|
console.log('MAIN:', main.substring(0, 3000))
|
|
console.log('ERRORS:', errors.join('\n'))
|
|
})
|