From 80ab68369f7ab0eb0175b3de722084d9629e9bf4 Mon Sep 17 00:00:00 2001 From: nfebe Date: Tue, 20 Jan 2026 19:29:06 +0100 Subject: [PATCH] test(sharing): expand advanced settings before accessing its elements Tests that access elements inside the Advanced Settings section (hide download, share label, grid view, etc.) must first click "Advanced settings" to expand it. Previously these tests relied on buggy auto-expand behavior that occurred when permissions didn't match bundled values. Signed-off-by: nfebe --- cypress/e2e/files_sharing/public-share/default-view.cy.ts | 1 + cypress/e2e/files_sharing/public-share/download.cy.ts | 3 +++ cypress/e2e/files_sharing/public-share/sidebar-tab.cy.ts | 1 + .../public-share/view_view-only-no-download.cy.ts | 1 + 4 files changed, 6 insertions(+) diff --git a/cypress/e2e/files_sharing/public-share/default-view.cy.ts b/cypress/e2e/files_sharing/public-share/default-view.cy.ts index e0880b237c3..c09c6de5085 100644 --- a/cypress/e2e/files_sharing/public-share/default-view.cy.ts +++ b/cypress/e2e/files_sharing/public-share/default-view.cy.ts @@ -76,6 +76,7 @@ describe('files_sharing: Public share - setting the default view mode', () => { .findByRole('button', { name: /Actions/i }) .click() cy.findByRole('menuitem', { name: /Customize link/i }).click() + cy.findByRole('button', { name: /Advanced settings/i }).click() cy.findByRole('checkbox', { name: /Show files in grid view/i }) .scrollIntoView() cy.findByRole('checkbox', { name: /Show files in grid view/i }) diff --git a/cypress/e2e/files_sharing/public-share/download.cy.ts b/cypress/e2e/files_sharing/public-share/download.cy.ts index bc08f0bdb1f..5c9c0ed7302 100644 --- a/cypress/e2e/files_sharing/public-share/download.cy.ts +++ b/cypress/e2e/files_sharing/public-share/download.cy.ts @@ -195,6 +195,7 @@ describe('files_sharing: Public share - downloading files', { testIsolation: tru triggerActionForFile('test', 'details') openLinkShareDetails(0) + cy.findByRole('button', { name: /advanced settings/i }).click() cy.intercept('PUT', '**/ocs/v2.php/apps/files_sharing/api/v1/shares/*').as('update') @@ -210,12 +211,14 @@ describe('files_sharing: Public share - downloading files', { testIsolation: tru cy.wait('@update') openLinkShareDetails(0) + cy.findByRole('button', { name: /advanced settings/i }).click() cy.findByRole('checkbox', { name: /hide download/i }) .should('be.checked') cy.reload() openLinkShareDetails(0) + cy.findByRole('button', { name: /advanced settings/i }).click() cy.findByRole('checkbox', { name: /hide download/i }) .should('be.checked') }) diff --git a/cypress/e2e/files_sharing/public-share/sidebar-tab.cy.ts b/cypress/e2e/files_sharing/public-share/sidebar-tab.cy.ts index 5d2da68bb58..0430ca9b2d1 100644 --- a/cypress/e2e/files_sharing/public-share/sidebar-tab.cy.ts +++ b/cypress/e2e/files_sharing/public-share/sidebar-tab.cy.ts @@ -27,6 +27,7 @@ describe('files_sharing: sidebar tab', () => { it('correctly lists shares by label with special characters', () => { createLinkShare({ user: alice }, 'test') openLinkShareDetails(0) + cy.findByRole('button', { name: /advanced settings/i }).click() cy.findByRole('textbox', { name: /share label/i }) .should('be.visible') .type('Alice\' share') diff --git a/cypress/e2e/files_sharing/public-share/view_view-only-no-download.cy.ts b/cypress/e2e/files_sharing/public-share/view_view-only-no-download.cy.ts index 1939f822a34..0545e7d88db 100644 --- a/cypress/e2e/files_sharing/public-share/view_view-only-no-download.cy.ts +++ b/cypress/e2e/files_sharing/public-share/view_view-only-no-download.cy.ts @@ -44,6 +44,7 @@ describe('files_sharing: Public share - View only', { testIsolation: true }, () .should('be.visible') cy.get('[data-cy-files-sharing-share-permissions-bundle="read-only"]') .click() + cy.findByRole('button', { name: /advanced settings/i }).click() cy.findByRole('checkbox', { name: 'Hide download' }) .check({ force: true }) // save the update