Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(cy): adjust selectors for filepicker
basename and extension are now split.

Signed-off-by: Max <[email protected]>
  • Loading branch information
max-nextcloud committed Aug 27, 2023
commit 0a3705ea19fe629ab468205ce276826b40d8c2d0
13 changes: 7 additions & 6 deletions cypress/e2e/attachments.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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()

Expand All @@ -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()

Expand Down
3 changes: 2 additions & 1 deletion cypress/e2e/nodes/Links.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down