Skip to content

Commit

Permalink
Add logout before each login in cypress test
Browse files Browse the repository at this point in the history
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
  • Loading branch information
come-nc committed Jan 2, 2024
1 parent c09c947 commit b918203
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cypress/e2e/groupfolders.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ describe('Groupfolders ACLs and trashbin behavior', () => {
setACLPermissions(groupFolderId, '/subfolder1', [`-${PERMISSION_READ}`], undefined, user2.userId)

// User1 has access
cy.logout()
cy.login(user1)
cy.visit('/apps/files')
enterFolder(groupFolderName)
Expand All @@ -108,13 +109,15 @@ describe('Groupfolders ACLs and trashbin behavior', () => {
fileOrFolderExists('file2.txt')

// User2 has no access
cy.logout()
cy.login(user2)
cy.visit('/apps/files')
enterFolder(groupFolderName)
fileOrFolderDoesNotExist('subfolder1')

// Delete files
cy.log('Deleting the files')
cy.logout()
cy.login(managerUser)
cy.visit('/apps/files')
enterFolder(groupFolderName)
Expand All @@ -126,20 +129,23 @@ describe('Groupfolders ACLs and trashbin behavior', () => {
deleteFile('subfolder2')

// User1 sees it in trash
cy.logout()
cy.login(user1)
cy.visit('/apps/files/trashbin')
fileOrFolderExistsInTrashbin('file1.txt')
enterFolderInTrashbin('subfolder2')
fileOrFolderExists('file2.txt')

// User2 does not
cy.logout()
cy.login(user2)
cy.visit('/apps/files/trashbin')
fileOrFolderDoesNotExistInTrashbin('file1.txt')
fileOrFolderDoesNotExistInTrashbin('subfolder2')

// Restore files
cy.log('Restoring the files')
cy.logout()
cy.login(managerUser)
cy.visit('/apps/files/trashbin')
fileOrFolderExistsInTrashbin('file1.txt')
Expand All @@ -148,6 +154,7 @@ describe('Groupfolders ACLs and trashbin behavior', () => {
restoreFile('subfolder2')

// User1 has access
cy.logout()
cy.login(user1)
cy.visit('/apps/files')
enterFolder(groupFolderName)
Expand All @@ -158,6 +165,7 @@ describe('Groupfolders ACLs and trashbin behavior', () => {
fileOrFolderExists('file2.txt')

// User2 has no access
cy.logout()
cy.login(user2)
cy.visit('/apps/files')
enterFolder(groupFolderName)
Expand Down

0 comments on commit b918203

Please sign in to comment.