Open cderv opened 2 months ago
Should we replace puppeteer
with playwright
everywhere in our issues going forward?
@mcanouil I believe puppeteer tag is about the rendering using chrome print we have internal to quarto, for example to have mermaid graph be image in PNG. it is different that the playwright stuff we have for tests. I mistitled indeed, but correctly put the testing tag, which seems enough.
Oh, thanks it add some sense to the previous comment.
Some of revealjs feature, and especially our quarto-support plugin can't be tested unless we do automated headless testing.
This issue is to store the potential test to implement.
Revealjs
Website
HTML
PDF snapshot ?
It seems we could leverage PDF.js directly (or through quarto preview ?) to have PDF loading in browser and then do screenshot. More at
https://github.com/microsoft/playwright/issues/19253
Example 1
````js // HTML template string no-op for VS Code highlighting / formatting function html(strings: TemplateStringsArray, ...values: unknown[]) { return strings.reduce((result, string, i) => { return result + string + (values[i] ?? ''); }, ''); } test('PDF has screenshot', async ({ page }) => { // Go to page without Content-Security-Policy header, to avoid CSP // prevention of script loading from https://mozilla.github.io await page.goto('about:blank'); await page.setContent(html`
`); await page.waitForTimeout(1000); await expect(page).toHaveScreenshot({ fullPage: true }); }); ````Example 2
https://github.com/microsoft/playwright/issues/19253#issuecomment-1339526966