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/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 3fcf8c9e720..a37bd0dd160 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -285,9 +285,7 @@ Cypress.Commands.add('propfindFolder', (path, depth = 0) => { }) Cypress.Commands.add('reloadFileList', () => { - return cy.get('.breadcrumb__crumbs .vue-crumb a') - .last() - .click({ force: true }) + return cy.reload() }) Cypress.Commands.add('openFolder', (name) => {