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
Next Next commit
ci(cypress): Fix selectors for new file picker
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr committed Aug 18, 2023
commit a3ed9771a3ac9e2243e248ada456d5b8680b2c67
24 changes: 12 additions & 12 deletions cypress/e2e/attachments.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,11 @@ describe('Test all attachment insertion methods', () => {
cy.intercept({ method: 'POST', url: '**/filepath' }).as(requestAlias)

cy.log('Go to sub folder (a)')
cy.get('#picker-filestable tr[data-entryname="sub"]').click()
cy.get('#picker-filestable tr[data-entryname="a"]').click()
cy.get('#picker-filestable tr[data-entryname="a.png"]').click()
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('.oc-dialog > .oc-dialog-buttonrow button').click()
cy.get('.dialog__actions button.button-vue--vue-primary').click()

return waitForRequestAndCheckAttachment(requestAlias)
})
Expand All @@ -194,13 +194,13 @@ describe('Test all attachment insertion methods', () => {
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.get('.breadcrumb__crumbs a[title="/sub"]').click()

cy.log('Go to sub folder (b)')
cy.get('#picker-filestable tr[data-entryname="b"]').click()
cy.get('#picker-filestable tr[data-entryname="b.png"]').click()
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('.oc-dialog > .oc-dialog-buttonrow button').click()
cy.get('.dialog__actions button.button-vue--vue-primary').click()

return waitForRequestAndCheckAttachment(requestAlias)
})
Expand All @@ -212,12 +212,12 @@ 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__main .breadcrumb__crumbs a').first().click()

cy.log('Select the file in the filepicker')
cy.get('#picker-filestable tr[data-entryname="github.png"]').click()
cy.get('.file-picker__main .file-picker__file-name[title="github.png"]').click()
cy.log('Click OK in the filepicker')
cy.get('.oc-dialog > .oc-dialog-buttonrow button').click()
cy.get('.dialog__actions button.button-vue--vue-primary').click()

return waitForRequestAndCheckAttachment(requestAlias)
})
Expand Down Expand Up @@ -367,7 +367,7 @@ describe('Test all attachment insertion methods', () => {
// check the file list
cy.get('.files-fileList tr[data-file="test.md"]', { timeout: 10000 })
.should('contain', 'test.md')
cy.get('files-fileList tr[data-file="github.png"]').should('not.exist')
cy.get('.files-fileList tr[data-file="github.png"]').should('not.exist')
cy.showHiddenFiles()

// check the attachment folder is not there
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/nodes/Links.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +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('.oc-dialog').find(`tr[data-entryname="${filename}"]`).click()
cy.get('.oc-dialog').find('.oc-dialog-buttonrow > button').click()
cy.get(`.file-picker__main .file-picker__file-name[title="${filename}"]`).click()
cy.get('.dialog__actions button.button-vue--vue-primary').click()

return cy.getContent()
.find(`a[href*="${encodeURIComponent(filename)}"]`)
Expand Down
8 changes: 4 additions & 4 deletions cypress/e2e/workspace.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@ describe('Workspace', function() {
cy.getSubmenuEntry('insert-link', 'insert-link-file')
.click()

cy.get('#picker-filestable tr[data-entryname="sub-folder"]').click()
cy.get('#picker-filestable tr[data-entryname="alpha"]').click()
cy.get('#picker-filestable tr[data-entryname="test.md"]').click()
cy.get('.oc-dialog > .oc-dialog-buttonrow button').click()
cy.get('.file-picker__main .file-picker__file-name[title="sub-folder"]').click()
cy.get('.file-picker__main .file-picker__file-name[title="alpha"]').click()
cy.get('.file-picker__main .file-picker__file-name[title="test.md"]').click()
cy.get('.dialog__actions button.button-vue--vue-primary').click()

cy.getEditor()
.find('a')
Expand Down