From 275e23c9b47b8566bc06314226e8713d0804eb9e Mon Sep 17 00:00:00 2001 From: Jonas Date: Mon, 9 Sep 2024 12:52:58 +0200 Subject: [PATCH] fix(cypress): Folder shares use new Files vue frontend now Signed-off-by: Jonas --- cypress/e2e/nodes/CodeBlock.spec.js | 2 +- cypress/e2e/share.spec.js | 6 +++--- cypress/support/commands.js | 6 ------ 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/cypress/e2e/nodes/CodeBlock.spec.js b/cypress/e2e/nodes/CodeBlock.spec.js index c4131bde7b7..996651b9486 100644 --- a/cypress/e2e/nodes/CodeBlock.spec.js +++ b/cypress/e2e/nodes/CodeBlock.spec.js @@ -77,7 +77,7 @@ describe('Front matter support', function() { cy.getContent().find('code').eq(1).find('.hljs-keyword').eq(1).contains('function') // Mermaid diagram - cy.get('#app-content').scrollTo('bottom') + cy.getEditor().scrollTo('bottom') cy.getContent().find('.split-view__preview').eq(2).should('be.visible') cy.get('.code-block').eq(2).find('code').should('not.be.visible') cy.get('.split-view__preview').find('svg .entityTitleText') diff --git a/cypress/e2e/share.spec.js b/cypress/e2e/share.spec.js index f2d8c21426f..0ef3b8212e7 100644 --- a/cypress/e2e/share.spec.js +++ b/cypress/e2e/share.spec.js @@ -95,7 +95,7 @@ describe('Open test.md in viewer', function() { return cy.visit(`/s/${token}`) }) .then(() => { - cy.openFileInShare('test.md') + cy.openFile('test.md') cy.getModal().getContent().should('be.visible') cy.getModal().getContent().should('contain', 'Hello world') cy.getModal().getContent().find('h2').should('contain', 'Hello world') @@ -105,8 +105,8 @@ describe('Open test.md in viewer', function() { }) }) - it('Opens the editor as guest', function() { - cy.shareFile('/test3.md') + it('Opens the editor as guest and set a session username', function() { + cy.shareFile('/test3.md', { edit: true }) .then((token) => { cy.logout() cy.visit(`/s/${token}`) diff --git a/cypress/support/commands.js b/cypress/support/commands.js index c5cf132ac5b..5f24001858f 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -272,12 +272,6 @@ Cypress.Commands.add('openFile', (fileName, params = {}) => { cy.get(`[data-cy-files-list] tr[data-cy-files-list-row-name="${fileName}"] [data-cy-files-list-row-name-link]`).click(params) }) -Cypress.Commands.add('openFileInShare', fileName => { - cy.get(`.files-fileList tr[data-file="${CSS.escape(fileName)}"] a.name`).click() - // eslint-disable-next-line - cy.wait(250) -}) - Cypress.Commands.add('closeFile', (params = {}) => { cy.intercept({ method: 'POST', url: '**/apps/text/session/*/close' }) .as('close')