From 9c46048f0f7e0dcf078c4ececa53158f1769d7ed Mon Sep 17 00:00:00 2001 From: Anthony LC Date: Fri, 4 Sep 2026 14:46:26 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=85(e2e)=20try=20to=20fix=20flakiness=20o?= =?UTF-8?q?n=20e2e=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We improve a test to try to reduce flakiness. We increase the throttles, to be sure that the e2e tests don't hit them. --- env.d/development/common.e2e | 14 ++++--- .../__tests__/app-impress/doc-tree.spec.ts | 38 +++++++++---------- 2 files changed, 28 insertions(+), 24 deletions(-) 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/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 }) => {