mirror of
https://github.com/nextcloud/server.git
synced 2026-02-27 20:10:37 -05:00
test: add cypress tests for sharing download permission
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
991c61dc04
commit
899faa77c1
2 changed files with 14 additions and 5 deletions
|
|
@ -19,9 +19,9 @@ export function createShare(fileName: string, username: string, shareSettings: P
|
|||
openSharingPanel(fileName)
|
||||
|
||||
cy.get('#app-sidebar-vue').within(() => {
|
||||
cy.get('#sharing-search-input').clear()
|
||||
cy.intercept({ times: 1, method: 'GET', url: '**/apps/files_sharing/api/v1/sharees?*' }).as('userSearch')
|
||||
cy.get('#sharing-search-input').type(username)
|
||||
cy.findByRole('combobox', { name: /Search for share recipients/i })
|
||||
.type(`{selectAll}${username}`)
|
||||
cy.wait('@userSearch')
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -118,15 +118,24 @@ export function createShare(context: ShareContext, shareName: string, options: S
|
|||
}
|
||||
|
||||
/**
|
||||
* Adjust share permissions to be editable
|
||||
* open link share details for specific index
|
||||
*
|
||||
* @param index
|
||||
*/
|
||||
function adjustSharePermission(): void {
|
||||
export function openLinkShareDetails(index: number) {
|
||||
cy.findByRole('list', { name: 'Link shares' })
|
||||
.findAllByRole('listitem')
|
||||
.first()
|
||||
.eq(index)
|
||||
.findByRole('button', { name: /Actions/i })
|
||||
.click()
|
||||
cy.findByRole('menuitem', { name: /Customize link/i }).click()
|
||||
}
|
||||
|
||||
/**
|
||||
* Adjust share permissions to be editable
|
||||
*/
|
||||
function adjustSharePermission(): void {
|
||||
openLinkShareDetails(0)
|
||||
|
||||
cy.get('[data-cy-files-sharing-share-permissions-bundle]').should('be.visible')
|
||||
cy.get('[data-cy-files-sharing-share-permissions-bundle="upload-edit"]').click()
|
||||
|
|
|
|||
Loading…
Reference in a new issue