diff options
Diffstat (limited to 'cypress')
-rw-r--r-- | cypress/e2e/files.cy.ts | 42 |
1 files changed, 35 insertions, 7 deletions
diff --git a/cypress/e2e/files.cy.ts b/cypress/e2e/files.cy.ts index ab2c22a8776..381d83912b8 100644 --- a/cypress/e2e/files.cy.ts +++ b/cypress/e2e/files.cy.ts @@ -30,18 +30,12 @@ const startCopyMove = (file: string) => { } describe('Login with a new user and open the files app', function() { - let currentUser: User - beforeEach(function() { + before(function() { cy.createRandomUser().then((user) => { - currentUser = user cy.login(user) }) }) - afterEach(function() { - cy.deleteUser(currentUser) - }) - Cypress.on('uncaught:exception', (err) => { // This can happen because of blink engine & skeleton animation, its not a bug just engine related. if (err.message.includes('ResizeObserver loop limit exceeded')) { @@ -54,6 +48,40 @@ describe('Login with a new user and open the files app', function() { cy.get('.files-fileList tr').should('contain', 'welcome.txt') }) + it('See the file list sorting order is saved', function() { + cy.intercept('PUT', /api\/v1\/views\/files\/sorting_direction$/).as('sorting_direction') + + cy.visit('/apps/files') + // default to sorting by name + cy.get('.files-filestable th.column-name .sort-indicator').should('be.visible') + // change to size + cy.get('.files-filestable th').contains('Size').click() + // size sorting should be active + cy.get('.files-filestable th.column-name .sort-indicator').should('not.be.visible') + cy.get('.files-filestable th.column-size .sort-indicator').should('be.visible') + cy.wait('@sorting_direction') + + // Re-visit + cy.visit('/apps/files') + // now sorting by name should be disabled and sorting by size should be enabled + cy.get('.files-filestable th.column-name .sort-indicator').should('not.be.visible') + cy.get('.files-filestable th.column-size .sort-indicator').should('be.visible') + }) +}) + +describe('Testing the copy move action (FilePicker)', () => { + let currentUser: User + beforeEach(function() { + cy.createRandomUser().then((user) => { + currentUser = user + cy.login(user) + }) + }) + + afterEach(function() { + cy.deleteUser(currentUser) + }) + it('Copy a file in its same folder', () => { cy.visit('/apps/files') // When I start the move or copy operation for "welcome.txt" |