Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable28] test(cy): use more robust selectors in file picker #5352

Merged
merged 1 commit into from
Feb 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
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
Loading