From 542ddbba76a0ac2d97fc7df698d8e8760bf1c0f0 Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 27 Aug 2023 19:22:05 +0200 Subject: [PATCH] fix(cy): adjust selectors for filepicker basename and extension are now split. Signed-off-by: Max --- cypress/e2e/attachments.spec.js | 13 +++++++------ cypress/e2e/nodes/Links.spec.js | 3 ++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/cypress/e2e/attachments.spec.js b/cypress/e2e/attachments.spec.js index 58420b55e14..13b188d459e 100644 --- a/cypress/e2e/attachments.spec.js +++ b/cypress/e2e/attachments.spec.js @@ -180,7 +180,7 @@ describe('Test all attachment insertion methods', () => { cy.log('Go to sub folder (a)') cy.get('.file-picker__main .file-picker__file-name[title="sub"]').click() cy.get('.file-picker__main .file-picker__file-name[title="a"]').click() - cy.get('.file-picker__main .file-picker__file-name[title="a.png"]').click() + cy.get('.file-picker__main .file-picker__file-name[title="a"]').click() cy.get('.dialog__actions button.button-vue--vue-primary').click() @@ -191,12 +191,13 @@ describe('Test all attachment insertion methods', () => { const requestAlias = 'insertPathRequest-b' cy.intercept({ method: 'POST', url: '**/filepath' }).as(requestAlias) - cy.log('Go back to sub folder') - cy.get('#oc-dialog-filepicker-content .dirtree [data-dir="/sub"] a').click() + cy.log('Go back from home to sub folder') + cy.get('.file-picker__breadcrumbs a[title="Home"]').click() + cy.get('.file-picker__main .file-picker__file-name[title="sub"]').click() cy.log('Go to sub folder (b)') cy.get('.file-picker__main .file-picker__file-name[title="b"]').click() - cy.get('.file-picker__main .file-picker__file-name[title="b.png"]').click() + cy.get('.file-picker__main .file-picker__file-name[title="b"]').click() cy.get('.dialog__actions button.button-vue--vue-primary').click() @@ -210,10 +211,10 @@ describe('Test all attachment insertion methods', () => { cy.intercept({ method: 'POST', url: '**/filepath' }).as(requestAlias) cy.log('Go back to home') - cy.get('#oc-dialog-filepicker-content .dirtree .crumb:first-child').click() + cy.get('.file-picker__breadcrumbs a[title="Home"]').click() cy.log('Select the file in the filepicker') - cy.get('.file-picker__main .file-picker__file-name[title="github.png"]').click() + cy.get('.file-picker__main .file-picker__file-name[title="github"]').click() cy.log('Click OK in the filepicker') cy.get('.dialog__actions button.button-vue--vue-primary').click() diff --git a/cypress/e2e/nodes/Links.spec.js b/cypress/e2e/nodes/Links.spec.js index 1fe5ccd729e..54cd96d998f 100644 --- a/cypress/e2e/nodes/Links.spec.js +++ b/cypress/e2e/nodes/Links.spec.js @@ -139,7 +139,8 @@ describe('test link marks', function() { // Helper to reduce duplicated code, checking inserting with and without selected text const checkLinkFile = (filename, text) => { cy.getSubmenuEntry('insert-link', 'insert-link-file').click() - cy.get(`.file-picker__main .file-picker__file-name[title="${filename}"]`).click() + const basename = filename.replace(/(.*)\.[^\.]*/, '$1') + cy.get(`.file-picker__main .file-picker__file-name[title="${basename}"]`).click() cy.get('.dialog__actions button.button-vue--vue-primary').click() return cy.getContent()