From a09b319f649e4b3e2f78251916aa336f17af2b83 Mon Sep 17 00:00:00 2001 From: Alexandre Bourdin Date: Tue, 7 Apr 2026 15:41:12 +0200 Subject: [PATCH] Merge pull request #32637 from overleaf/ab-fix-32057-server-pro-link-sharing-retry [web] Fix project sharing E2E test retry when link sharing is disabled GitOrigin-RevId: fb46f2cc2a14e6c4f12be2b070b9185e532b4db9 --- server-ce/test/project-sharing.spec.ts | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/server-ce/test/project-sharing.spec.ts b/server-ce/test/project-sharing.spec.ts index c20167b651..9e006ae5d2 100644 --- a/server-ce/test/project-sharing.spec.ts +++ b/server-ce/test/project-sharing.spec.ts @@ -27,7 +27,19 @@ describe('Project Sharing', function () { let projectName: string let recompile: () => void let waitForCompile: (triggerCompile: () => void) => void + + // Link-sharing urls have to be created before disabling link sharing. + // We use the `beforeEach` hook to reload the server with link sharing + // disabled **after** the initial setup which happens in the `before` + // block. The `before` hook always runs prior to the `beforeEach` hook. + + // Set up retained access before disabling link sharing beforeWithReRunOnTestRetry(() => { + // undo the link sharing restriction before joining via link-sharing below + cy.wrap(reloadWith({ withDataDir: true, pro: true }), { + timeout: STARTUP_TIMEOUT, + }) + projectName = getSpamSafeProjectName() ;({ recompile, waitForCompile } = prepareWaitForNextCompileSlot()) setupTestProject() @@ -424,17 +436,7 @@ describe('Project Sharing', function () { const retainedEditorEmail = 'collaborator-retained-editor@example.com' ensureUserExists({ email: retainedEditorEmail }) - // Link-sharing urls have to be created before disabling link sharing. - // We use the `beforeEach` hook to reload the server with link sharing - // disabled **after** the initial setup which happens in the `before` - // block. The `before` hook always runs prior to the `beforeEach` hook. - - // Set up retained access before disabling link sharing beforeWithReRunOnTestRetry(() => { - // undo the link sharing restriction before joining via link-sharing below - cy.wrap(reloadWith({ withDataDir: true, pro: true }), { - timeout: STARTUP_TIMEOUT, - }) // Set up retained viewer access login(retainedViewerEmail) openProjectViaLinkSharingAsUser(