Skip to content

Commit

Permalink
Merge pull request #5352 from nextcloud/backport/5349/stable28
Browse files Browse the repository at this point in the history
[stable28] test(cy): use more robust selectors in file picker
  • Loading branch information
max-nextcloud authored Feb 4, 2024
2 parents 6e94798 + b4bdd39 commit db72e0f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
18 changes: 9 additions & 9 deletions cypress/e2e/attachments.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ describe('Test all attachment insertion methods', () => {
cy.intercept({ method: 'POST', url: '**/filepath' }).as(requestAlias)

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"]').click()
cy.get('.file-picker [data-filename="sub"]').click()
cy.get('.file-picker [data-filename="a"]').click()
cy.get('.file-picker [data-filename="a.png"]').click()

cy.get('.dialog__actions button.button-vue--vue-primary').click()

Expand All @@ -198,12 +198,12 @@ describe('Test all attachment insertion methods', () => {
cy.intercept({ method: 'POST', url: '**/filepath' }).as(requestAlias)

cy.log('Go back from home to sub folder')
cy.get('.file-picker__breadcrumbs button[title="Home"]').click()
cy.get('.file-picker__main .file-picker__file-name[title="sub"]').click()
cy.get('.file-picker nav [aria-label="Home"]').click()
cy.get('.file-picker [data-filename="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"]').click()
cy.get('.file-picker [data-filename="b"]').click()
cy.get('.file-picker [data-filename="b.png"]').click()

cy.get('.dialog__actions button.button-vue--vue-primary').click()

Expand All @@ -217,10 +217,10 @@ describe('Test all attachment insertion methods', () => {
cy.intercept({ method: 'POST', url: '**/filepath' }).as(requestAlias)

cy.log('Go back to home')
cy.get('.file-picker__breadcrumbs button[title="Home"]').click()
cy.get('.file-picker nav [aria-label="Home"]').click()

cy.log('Select the file in the filepicker')
cy.get('.file-picker__main .file-picker__file-name[title="github"]').click()
cy.get('.file-picker [data-filename="github.png"]').click()
cy.log('Click OK in the filepicker')
cy.get('.dialog__actions button.button-vue--vue-primary').click()

Expand Down
6 changes: 3 additions & 3 deletions cypress/e2e/workspace.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ describe('Workspace', function() {
cy.getSubmenuEntry('insert-link', 'insert-link-file')
.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"]').click()
cy.get('.file-picker [data-filename="sub-folder"]').click()
cy.get('.file-picker [data-filename="alpha"]').click()
cy.get('.file-picker [data-filename="test.md"]').click()
cy.get('.dialog__actions button.button-vue--vue-primary').click()

cy.getEditor()
Expand Down

0 comments on commit db72e0f

Please sign in to comment.