diff --git a/cypress/e2e/settings.spec.js b/cypress/e2e/settings.spec.js index b1c1ace3ad..081c9357d8 100644 --- a/cypress/e2e/settings.spec.js +++ b/cypress/e2e/settings.spec.js @@ -64,6 +64,8 @@ describe('Settings', function() { cy.get('button').contains('Choose') .click() cy.wait('@setCollectivesFolder') + cy.getCollectivesFolder() + .should('be.equal', `/${randomFolder}`) // Check if collectives are found in new folder in Files app cy.log('Check if collectives are in configured user folder') @@ -73,27 +75,7 @@ describe('Settings', function() { cy.fileList().should('contain', 'A Collective') // Change user folder back to default - cy.log('Change user folder back to default') - cy.visit('/apps/collectives') - cy.get('#app-settings') - .click() - cy.get('input[name="userFolder"]') - .click() - cy.wait('@propfindFolder') - - // Open home folder - cy.get('[data-dir=""] > a, a[title="Home"]') - .click() - cy.wait('@propfindFolder') - - // Open and select default folder - cy.get(filePickerListSelector).contains('Collectives') - .click() - cy.get(filePickerListSelector).contains('Collectives') - .should('not.exist') - cy.get('button').contains('Choose') - .click() - cy.wait('@setCollectivesFolder') + cy.setCollectivesFolder('/Collectives') }) }) }) diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 8f41b7383b..8174fd84f5 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -208,6 +208,13 @@ Cypress.Commands.add('getCollectives', () => { .then(response => response.data.data) }) +Cypress.Commands.add('getCollectivesFolder', () => { + return api.getCollectivesFolder() + .then(response => response.data.ocs.data) +}) + +Cypress.Commands.add('setCollectivesFolder', api.setCollectivesFolder) + /** * Move a collective into the trash if it exists. *