Générateur de portfolios PDF Figures Libres (app Nuxt autonome)
App Nuxt 3 + Nuxt UI qui lit les projets du CMS Grav et compose des portfolios A3 paysage exportés en PDF (gabarit book_v3) : composeur WYSIWYG, templates cover/toc/projet/grille/page libre, pipeline Playwright + Ghostscript, gel du contenu à la génération, partage public opt-in. Dépôt autonome : Dockerfile (base Playwright + Ghostscript + ffmpeg + rsync) inclus. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
20
scripts/dev-test-generate.mjs
Normal file
20
scripts/dev-test-generate.mjs
Normal file
@@ -0,0 +1,20 @@
|
||||
// Test E2E du flux de génération PDF depuis le composeur (auto-contrôle dev).
|
||||
import { chromium } from 'playwright'
|
||||
|
||||
const [, , id] = process.argv
|
||||
const base = process.env.BASE_URL ?? 'http://localhost:3000'
|
||||
|
||||
const browser = await chromium.launch()
|
||||
const page = await browser.newPage({ viewportSize: { width: 1600, height: 900 } })
|
||||
await page.request.post(`${base}/api/auth/login`, {
|
||||
data: { password: process.env.NUXT_PORTFOLIO_PASSWORD ?? 'figureslibres' },
|
||||
})
|
||||
await page.goto(`${base}/portfolios/${id}`, { waitUntil: 'networkidle' })
|
||||
|
||||
await page.getByRole('button', { name: 'Générer le PDF' }).click()
|
||||
await page.waitForTimeout(500)
|
||||
await page.getByRole('button', { name: 'Générer', exact: true }).click()
|
||||
await page.getByRole('link', { name: 'Télécharger' }).waitFor({ timeout: 180_000 })
|
||||
await page.screenshot({ path: '/app/data/cache/generate-modal.png' })
|
||||
console.log('génération OK, lien de téléchargement affiché')
|
||||
await browser.close()
|
||||
Reference in New Issue
Block a user