From 6e92f3b02ad0d81b7d1514ed868c78a535f00864 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Tue, 28 Jul 2026 19:18:05 +0200 Subject: [PATCH] test: reduce flakyness of files version tests Those tests are pretty slow, even locally they took 11s for one test. Timeout is 30s, so on crowded CI this often failed. Fixed with: 1. Reduce number of page loads by simply navigating back to parent folder using breadcrumbs (reduces run time by 4s per test locally) 2. Mark as slow as setup still takes some time. Signed-off-by: Ferdinand Thiessen --- .../version-cross-share-move-and-copy.spec.ts | 10 ++++++---- tests/playwright/support/sections/FilesListPage.ts | 10 ++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/tests/playwright/e2e/files_versions/version-cross-share-move-and-copy.spec.ts b/tests/playwright/e2e/files_versions/version-cross-share-move-and-copy.spec.ts index 632dd2c54d848..ad840637c2f9a 100644 --- a/tests/playwright/e2e/files_versions/version-cross-share-move-and-copy.spec.ts +++ b/tests/playwright/e2e/files_versions/version-cross-share-move-and-copy.spec.ts @@ -121,6 +121,10 @@ async function copyToRoot(filesListPage: FilesListPage, copyMoveDialog: CopyMove } test.describe('files_versions: versions across a share move/copy', () => { + // Every test here seeds a share, boots the files app twice, + // and walks the sidebar, the versions list and the move/copy picker. + test.slow() + test('moves the versions when the file is moved out of a received share', async ({ page, user, owner, ownerRequest, filesListPage, versionsTab, filesSidebar, copyMoveDialog }) => { await seedSharedVersionedFile(owner, ownerRequest, user, page.request, FILE_NAME) await nameInitialVersion(filesListPage, versionsTab, SHARED_FOLDER, FILE_NAME) @@ -150,8 +154,7 @@ test.describe('files_versions: versions across a share move/copy', () => { await nameInitialVersion(filesListPage, versionsTab, `${SHARED_FOLDER}/${subFolder}/${subSubFolder}`, FILE_NAME) await filesSidebar.close() - await filesListPage.open() - await filesListPage.navigateToFolder(SHARED_FOLDER) + await filesListPage.navigateToBreadcrumb(SHARED_FOLDER) await moveToRoot(filesListPage, copyMoveDialog, subFolder) await assertVersionsContent(filesListPage, versionsTab, relPath, { expectLabel: true }) @@ -165,8 +168,7 @@ test.describe('files_versions: versions across a share move/copy', () => { await nameInitialVersion(filesListPage, versionsTab, `${SHARED_FOLDER}/${subFolder}/${subSubFolder}`, FILE_NAME) await filesSidebar.close() - await filesListPage.open() - await filesListPage.navigateToFolder(SHARED_FOLDER) + await filesListPage.navigateToBreadcrumb(SHARED_FOLDER) await copyToRoot(filesListPage, copyMoveDialog, subFolder) await assertVersionsContent(filesListPage, versionsTab, relPath, { expectLabel: false }) diff --git a/tests/playwright/support/sections/FilesListPage.ts b/tests/playwright/support/sections/FilesListPage.ts index 797e65a2b9dd9..eaa4ae42c8d04 100644 --- a/tests/playwright/support/sections/FilesListPage.ts +++ b/tests/playwright/support/sections/FilesListPage.ts @@ -74,6 +74,16 @@ export class FilesListPage { return this.page.getByRole('navigation', { name: 'Current directory path' }) } + /** + * Navigate to an ancestor of the current folder through the breadcrumb + * + * @param name - The label of the crumb to navigate to + */ + async navigateToBreadcrumb(name: string): Promise { + await this.getBreadcrumbs().getByRole('button', { name, exact: true }).click() + await this.waitForListLoaded() + } + getRowForFile(filename: string): Locator { return this.page.locator(`[data-cy-files-list-row-name="${escapeAttributeValue(filename)}"]`) }