(e2e) webp image with export tests

We added a new webp image to the e2e tests and updated the export
tests to include this new image format.
This ensures that the export functionality correctly
handles webp images, maintaining compatibility and
performance across different image formats.
We increase throttles, to be sure that the e2e tests
don't hit them.
This commit is contained in:
Anthony LC
2026-09-08 12:10:08 +02:00
parent ebde46109f
commit 5728fcdfbc
4 changed files with 20 additions and 20 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

@@ -4,7 +4,7 @@ import { Page } from '@playwright/test';
export const getEditor = async ({ page }: { page: Page }) => {
const editor = page.locator('.--docs--editor-container .ProseMirror');
await editor.click();
await editor.focus();
return editor;
};
@@ -64,7 +64,7 @@ export const overrideDocContent = async ({
await page.waitForTimeout(1000);
// Add a simple Image PNG (1 IDAT chunk)
// Add image PNG
await openSuggestionMenu({
page,
suggestion: 'Resizable image with caption',
@@ -73,24 +73,6 @@ export const overrideDocContent = async ({
await page.getByText('Upload image').click();
const fileChooserPNG = await fileChooserPNGPromise;
await fileChooserPNG.setFiles(
path.join(__dirname, 'assets/logo-suite-numerique.png'),
);
const imagePng = page
.locator('.--docs--editor-container')
.getByRole('img', { name: 'logo-suite-numerique.png' });
await expect(imagePng).toBeVisible();
await page.waitForTimeout(1000);
// Add a more complex Image PNG (45 IDAT chunks)
await openSuggestionMenu({
page,
suggestion: 'Resizable image with caption',
});
const fileChooserComplexPNGPromise = page.waitForEvent('filechooser');
await page.getByText('Upload image').click();
const fileChooserComplexPNG = await fileChooserComplexPNGPromise;
await fileChooserComplexPNG.setFiles(
path.join(__dirname, 'assets/issue-860-complex-image.png'),
);
const complexImagePng = page
@@ -100,6 +82,24 @@ export const overrideDocContent = async ({
await page.waitForTimeout(1000);
// Add image WEBP
await openSuggestionMenu({
page,
suggestion: 'Resizable image with caption',
});
const fileChooserWEBPPromise = page.waitForEvent('filechooser');
await page.getByText('Upload image').click();
const fileChooserWEBP = await fileChooserWEBPPromise;
await fileChooserWEBP.setFiles(
path.join(__dirname, 'assets/webp-image.webp'),
);
const complexImageWebP = page
.locator('.--docs--editor-container')
.getByRole('img', { name: 'webp-image.webp' });
await expect(complexImageWebP).toBeVisible();
await page.waitForTimeout(1000);
return randomDoc;
};