diff --git a/cypress/e2e/attachments.spec.js b/cypress/e2e/attachments.spec.js index 6515b576455..39b209801d8 100644 --- a/cypress/e2e/attachments.spec.js +++ b/cypress/e2e/attachments.spec.js @@ -360,14 +360,14 @@ describe('Test all attachment insertion methods', () => { it('[share] check everything behaves correctly on the share target user side', () => { // check the file list - cy.get('test.md') + cy.getFile('test.md') .should('contain', 'test.md') - cy.get('github.png') + cy.getFile('github.png') .should('not.exist') cy.showHiddenFiles() // check the attachment folder is not there - cy.get('test.md') + cy.getFile('test.md') .should('exist') .should('have.attr', 'data-cy-files-list-row-fileid') .then((documentId) => { diff --git a/cypress/e2e/nodes/Mentions.spec.js b/cypress/e2e/nodes/Mentions.spec.js index e732ea866b3..f62d4a6866b 100644 --- a/cypress/e2e/nodes/Mentions.spec.js +++ b/cypress/e2e/nodes/Mentions.spec.js @@ -7,16 +7,10 @@ const currentUser = user const fileName = 'empty.md' -const refresh = () => { - cy.get('.files-controls .crumb:not(.hidden) a') - .last() - .click({ force: true }) -} - const createFileWithMention = (target, userToMention) => { const content = `Hello @[${userToMention}](mention://user/${userToMention})` cy.createFile(target, content) - .then(refresh) + .then(() => cy.reloadFileList()) } describe('Test mentioning users', () => { diff --git a/cypress/e2e/workspace.spec.js b/cypress/e2e/workspace.spec.js index 3fa86839d40..204e26fde63 100644 --- a/cypress/e2e/workspace.spec.js +++ b/cypress/e2e/workspace.spec.js @@ -44,7 +44,7 @@ describe('Workspace', function() { cy.uploadFile('test.md', 'text/markdown', `${currentFolder}/README.md`) cy.createFolder(`${currentFolder}/subdirectory`) cy.visit(`apps/files?dir=/${encodeURIComponent(currentFolder)}`) - cy.getFile('README.md').should('contain', 'README.md') + cy.getFile('README.md') cy.get('#rich-workspace .ProseMirror') .should('contain', 'Hello world') cy.openFolder('subdirectory') @@ -56,7 +56,7 @@ describe('Workspace', function() { it('Hides the workspace when switching to another view', function() { cy.uploadFile('test.md', 'text/markdown', `${currentFolder}/README.md`) cy.visit(`apps/files?dir=/${encodeURIComponent(currentFolder)}`) - cy.getFile('README.md').should('contain', 'README.md') + cy.getFile('README.md') cy.get('#rich-workspace .ProseMirror') .should('contain', 'Hello world') cy.get('a[href*="/apps/files/recent"]') @@ -121,7 +121,7 @@ describe('Workspace', function() { it('takes README.md into account', function() { cy.uploadFile('test.md', 'text/markdown', `${Cypress.currentTest.title}/README.md`) cy.visit(`apps/files?dir=/${encodeURIComponent(currentFolder)}`) - cy.getFile('README.md').should('contain', 'README.md') + cy.getFile('README.md') cy.get('#rich-workspace .ProseMirror') .should('contain', 'Hello world') }) @@ -238,7 +238,7 @@ describe('Workspace', function() { cy.modifyUser(user, 'language', 'de_DE') cy.uploadFile('test.md', 'text/markdown', `${Cypress.currentTest.title}/Anleitung.md`) cy.visit(`apps/files?dir=/${encodeURIComponent(currentFolder)}`) - cy.getFile('Anleitung.md').should('contain', 'Anleitung.md') + cy.getFile('Anleitung.md') cy.get('#rich-workspace .ProseMirror') .should('contain', 'Hello world') }) @@ -247,7 +247,7 @@ describe('Workspace', function() { cy.modifyUser(user, 'language', 'fr') cy.uploadFile('test.md', 'text/markdown', `${Cypress.currentTest.title}/Anleitung.md`) cy.visit(`apps/files?dir=/${encodeURIComponent(currentFolder)}`) - cy.getFile('Anleitung.md').should('contain', 'Anleitung.md') + cy.getFile('Anleitung.md') }) }) @@ -291,7 +291,6 @@ describe('Workspace', function() { }) const openSidebar = filename => { - cy.getFile(filename).should('contain', filename) cy.getFile(filename).find('.files-list__row-mtime').click() cy.get('.app-sidebar-header').should('contain', filename) } diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 6fd06744ca0..571d98821ba 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -284,8 +284,9 @@ Cypress.Commands.add('propfindFolder', (path, depth = 0) => { }) }) -// FIXME: proper file list reload only once that is possible with the vue files app -Cypress.Commands.add('reloadFileList', () => cy.reload()) +Cypress.Commands.add('reloadFileList', () => { + return cy.reload() +}) Cypress.Commands.add('openFolder', (name) => { const url = `**/${encodeURI(name)}`