From 18feab10cbeadaf7643882ff308764935c8d5af3 Mon Sep 17 00:00:00 2001 From: Anthony LC Date: Fri, 17 Oct 2025 22:44:35 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=85(e2e)=20reduce=20flakinees?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Because of parallel test execution, some tests were flaky when using goToGridDoc, the title changed between the time we got the document list and the time we clicked on the document. - Improve addChild function. --- .../app-impress/doc-member-list.spec.ts | 21 ++++++++++++++----- .../app-impress/doc-trashbin.spec.ts | 1 + .../__tests__/app-impress/utils-sub-pages.ts | 4 +++- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/frontend/apps/e2e/__tests__/app-impress/doc-member-list.spec.ts b/src/frontend/apps/e2e/__tests__/app-impress/doc-member-list.spec.ts index cb574d1e..761b9a9d 100644 --- a/src/frontend/apps/e2e/__tests__/app-impress/doc-member-list.spec.ts +++ b/src/frontend/apps/e2e/__tests__/app-impress/doc-member-list.spec.ts @@ -1,6 +1,6 @@ import { expect, test } from '@playwright/test'; -import { createDoc, goToGridDoc, verifyDocName } from './utils-common'; +import { createDoc, verifyDocName } from './utils-common'; import { addNewMember } from './utils-share'; test.beforeEach(async ({ page }) => { @@ -8,8 +8,14 @@ test.beforeEach(async ({ page }) => { }); test.describe('Document list members', () => { - test('it checks a big list of members', async ({ page }) => { - const docTitle = await goToGridDoc(page); + test('it checks a big list of members', async ({ page, browserName }) => { + const [docTitle] = await createDoc( + page, + 'members-big-members-list', + browserName, + 1, + ); + await verifyDocName(page, docTitle); // Get the current URL and extract the last part @@ -73,7 +79,7 @@ test.describe('Document list members', () => { await expect(loadMore).toBeHidden(); }); - test('it checks a big list of invitations', async ({ page }) => { + test('it checks a big list of invitations', async ({ page, browserName }) => { await page.route( /.*\/documents\/.*\/invitations\/\?page=.*/, async (route) => { @@ -108,7 +114,12 @@ test.describe('Document list members', () => { }, ); - const docTitle = await goToGridDoc(page); + const [docTitle] = await createDoc( + page, + 'members-big-invitation-list', + browserName, + 1, + ); await verifyDocName(page, docTitle); await page.getByRole('button', { name: 'Share' }).click(); diff --git a/src/frontend/apps/e2e/__tests__/app-impress/doc-trashbin.spec.ts b/src/frontend/apps/e2e/__tests__/app-impress/doc-trashbin.spec.ts index ff506587..5a445a60 100644 --- a/src/frontend/apps/e2e/__tests__/app-impress/doc-trashbin.spec.ts +++ b/src/frontend/apps/e2e/__tests__/app-impress/doc-trashbin.spec.ts @@ -102,6 +102,7 @@ test.describe('Doc Trashbin', () => { page, browserName, docParent: subDocName, + docName: 'my-trash-editor-subsubdoc', }); await verifyDocName(page, subsubDocName); diff --git a/src/frontend/apps/e2e/__tests__/app-impress/utils-sub-pages.ts b/src/frontend/apps/e2e/__tests__/app-impress/utils-sub-pages.ts index b4971230..a5eb02d8 100644 --- a/src/frontend/apps/e2e/__tests__/app-impress/utils-sub-pages.ts +++ b/src/frontend/apps/e2e/__tests__/app-impress/utils-sub-pages.ts @@ -72,10 +72,12 @@ export const addChild = async ({ page, browserName, docParent, + docName, }: { page: Page; browserName: BrowserName; docParent: string; + docName: string; }) => { let item = page.getByTestId('doc-tree-root-item'); @@ -99,7 +101,7 @@ export const addChild = async ({ await item.hover(); await item.getByTestId('doc-tree-item-actions-add-child').click(); - const [name] = randomName(docParent, browserName, 1); + const [name] = randomName(docName, browserName, 1); await updateDocTitle(page, name); return name;