diff --git a/env.d/development/common.e2e b/env.d/development/common.e2e index 6a2131c78..cd8ba029f 100644 --- a/env.d/development/common.e2e +++ b/env.d/development/common.e2e @@ -1,10 +1,14 @@ # For the CI job test-e2e -BURST_THROTTLE_RATES="1000/minute" +BURST_THROTTLE_RATES="2000/minute" COLLABORATION_API_URL=http://y-provider:4444/collaboration/api/ -SUSTAINED_THROTTLE_RATES="1000/minute" +SUSTAINED_THROTTLE_RATES="2000/minute" Y_PROVIDER_API_BASE_URL=http://y-provider-converter:4444/api/ # Throttle -API_DOCUMENT_THROTTLE_RATE=1000/min -API_DOCUMENT_ACCESS_THROTTLE_RATE=1000/min -API_CONFIG_THROTTLE_RATE=1000/min +API_CONFIG_THROTTLE_RATE=2000/min +API_DOCUMENT_ACCESS_THROTTLE_RATE=2000/min +API_DOCUMENT_ASK_FOR_ACCESS_THROTTLE_RATE=2000/min +API_DOCUMENT_THROTTLE_RATE=2000/min +API_INVITATION_THROTTLE_RATE=2000/min +API_USERS_LIST_THROTTLE_RATE_BURST=2000/min +API_USERS_LIST_THROTTLE_RATE_SUSTAINED=2000/min diff --git a/src/frontend/apps/e2e/__tests__/app-impress/assets/doc-export-regressions.pdf b/src/frontend/apps/e2e/__tests__/app-impress/assets/doc-export-regressions.pdf index 32fdd97f1..818939614 100644 Binary files a/src/frontend/apps/e2e/__tests__/app-impress/assets/doc-export-regressions.pdf and b/src/frontend/apps/e2e/__tests__/app-impress/assets/doc-export-regressions.pdf differ diff --git a/src/frontend/apps/e2e/__tests__/app-impress/assets/webp-image.webp b/src/frontend/apps/e2e/__tests__/app-impress/assets/webp-image.webp new file mode 100644 index 000000000..7f233197b Binary files /dev/null and b/src/frontend/apps/e2e/__tests__/app-impress/assets/webp-image.webp differ diff --git a/src/frontend/apps/e2e/__tests__/app-impress/doc-tree.spec.ts b/src/frontend/apps/e2e/__tests__/app-impress/doc-tree.spec.ts index a10fdda94..88b9f1b73 100644 --- a/src/frontend/apps/e2e/__tests__/app-impress/doc-tree.spec.ts +++ b/src/frontend/apps/e2e/__tests__/app-impress/doc-tree.spec.ts @@ -4,16 +4,10 @@ import { clickInDocOptionMenu, createDoc, getOtherBrowserName, - updateDocTitle, verifyDocName, } from './utils-common'; import { addNewMember, connectOtherUserToDoc } from './utils-share'; -import { - addChild, - clickOnAddRootSubPage, - createRootSubPage, - getTreeRow, -} from './utils-sub-pages'; +import { addChild, createRootSubPage, getTreeRow } from './utils-sub-pages'; test.describe('Doc Tree', () => { test.beforeEach(async ({ page }) => { @@ -157,17 +151,23 @@ test.describe('Doc Tree', () => { const docTree = page.getByTestId('doc-tree'); // Create first sub page - await clickOnAddRootSubPage(page); - await updateDocTitle(page, 'first move'); + const { name: docChild1 } = await createRootSubPage( + page, + browserName, + 'first move', + ); // Create second sub page - await clickOnAddRootSubPage(page); - await updateDocTitle(page, 'second move'); + const { name: docChild2 } = await createRootSubPage( + page, + browserName, + 'second move', + ); await page.waitForTimeout(500); // Wait for the tree to be stable - const firstSubPageItem = docTree.getByText('first move').first(); - const secondSubPageItem = docTree.getByText('second move').first(); + const firstSubPageItem = docTree.getByText(docChild1).first(); + const secondSubPageItem = docTree.getByText(docChild2).first(); // check that the sub pages are visible in the tree await expect(firstSubPageItem).toBeVisible(); @@ -178,8 +178,8 @@ test.describe('Doc Tree', () => { await expect(allSubPageItems).toHaveCount(2); // Check that elements are in the correct order - await expect(allSubPageItems.nth(0).getByText('first move')).toBeVisible(); - await expect(allSubPageItems.nth(1).getByText('second move')).toBeVisible(); + await expect(allSubPageItems.nth(0).getByText(docChild1)).toBeVisible(); + await expect(allSubPageItems.nth(1).getByText(docChild2)).toBeVisible(); // Will move the first sub page to the second position // Wait for elements to be stable before reading their positions — a React @@ -211,8 +211,8 @@ test.describe('Doc Tree', () => { // Wait for the reorder to be reflected in the tree before reloading — // this also ensures the API call has had time to persist the new order. - await expect(allSubPageItems.nth(0).getByText('second move')).toBeVisible(); - await expect(allSubPageItems.nth(1).getByText('first move')).toBeVisible(); + await expect(allSubPageItems.nth(0).getByText(docChild2)).toBeVisible(); + await expect(allSubPageItems.nth(1).getByText(docChild1)).toBeVisible(); // reload the page await page.reload(); @@ -222,8 +222,8 @@ test.describe('Doc Tree', () => { await expect(secondSubPageItem).toBeVisible(); // Check that elements are in the correct order - await expect(allSubPageItems.nth(0).getByText('second move')).toBeVisible(); - await expect(allSubPageItems.nth(1).getByText('first move')).toBeVisible(); + await expect(allSubPageItems.nth(0).getByText(docChild2)).toBeVisible(); + await expect(allSubPageItems.nth(1).getByText(docChild1)).toBeVisible(); }); test('it detaches a document', async ({ page, browserName }) => { diff --git a/src/frontend/apps/e2e/__tests__/app-impress/utils-export.ts b/src/frontend/apps/e2e/__tests__/app-impress/utils-export.ts index 12ece0a19..75106f75a 100644 --- a/src/frontend/apps/e2e/__tests__/app-impress/utils-export.ts +++ b/src/frontend/apps/e2e/__tests__/app-impress/utils-export.ts @@ -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; };