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
This commit is contained in:
Alexandre Bourdin
2026-04-07 15:41:12 +02:00
committed by Copybot
parent bf41ecdb39
commit a09b319f64

View File

@@ -27,7 +27,19 @@ describe('Project Sharing', function () {
let projectName: string let projectName: string
let recompile: () => void let recompile: () => void
let waitForCompile: (triggerCompile: () => void) => 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(() => { beforeWithReRunOnTestRetry(() => {
// undo the link sharing restriction before joining via link-sharing below
cy.wrap(reloadWith({ withDataDir: true, pro: true }), {
timeout: STARTUP_TIMEOUT,
})
projectName = getSpamSafeProjectName() projectName = getSpamSafeProjectName()
;({ recompile, waitForCompile } = prepareWaitForNextCompileSlot()) ;({ recompile, waitForCompile } = prepareWaitForNextCompileSlot())
setupTestProject() setupTestProject()
@@ -424,17 +436,7 @@ describe('Project Sharing', function () {
const retainedEditorEmail = 'collaborator-retained-editor@example.com' const retainedEditorEmail = 'collaborator-retained-editor@example.com'
ensureUserExists({ email: retainedEditorEmail }) 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(() => { 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 // Set up retained viewer access
login(retainedViewerEmail) login(retainedViewerEmail)
openProjectViaLinkSharingAsUser( openProjectViaLinkSharingAsUser(