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 <fenn25.fn@gmail.com>
This commit is contained in:
nfebe 2026-01-20 19:29:06 +01:00
parent 2cdbd7fa15
commit 80ab68369f
4 changed files with 6 additions and 0 deletions

View file

@ -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 })

View file

@ -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')
})

View file

@ -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')

View file

@ -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