Skip to content

Commit

Permalink
chore(cypress): Fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Ng <[email protected]>
  • Loading branch information
Pytal authored and juliusknorr committed Feb 8, 2024
1 parent 4538aa8 commit 976b830
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
8 changes: 4 additions & 4 deletions cypress/e2e/nodes/Table.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ describe('table plugin', () => {
.should('contain', 'content')

cy.getContent()
.find('[data-text-table-actions="settings"]').click()
.find('[data-text-table-actions="settings"] [aria-label="Actions"]').click()

cy.get('[data-text-table-action="delete"]').click()
cy.get('[data-text-table-action="delete"] [role="menuitem"]').click()
cy.getContent()
.should('not.contain', 'content')
})
Expand Down Expand Up @@ -80,7 +80,7 @@ describe('table plugin', () => {
cy.getContent()
.find('table tr:first-child th:first-child button')
.click()
cy.get(`[data-text-table-action="align-column-${align}"]`)
cy.get(`[data-text-table-action="align-column-${align}"] [role="menuitemradio"]`)
.click()
// Check header has correct text align and text is preserved
cy.getContent()
Expand All @@ -101,7 +101,7 @@ describe('table plugin', () => {
cy.getContent()
.find('table tr:first-child th:first-child button')
.click()
cy.get('[data-text-table-action="align-column-center"]')
cy.get('[data-text-table-action="align-column-center"] [role="menuitemradio"]')
.click()

// Test before adding a row
Expand Down
18 changes: 9 additions & 9 deletions cypress/e2e/versions.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ describe('Versions', () => {
cy.get('[data-cy-files-list-row-name="' + versionFileName + '"] [data-cy-files-list-row-mtime]').click()
cy.get('.app-sidebar-header').should('be.visible').should('contain', versionFileName)
cy.get('.app-sidebar-tabs__tab:contains("Versions")').click()
cy.get('[data-files-versions-versions-list] li > a').should('have.length', 3)
cy.get('[data-files-versions-versions-list] li a').should('have.length', 3)

cy.get('[data-files-versions-versions-list] li > a').eq(1).click()
cy.get('[data-files-versions-versions-list] li a').eq(1).click()
cy.get('.viewer__content #read-only-editor')
.find('h1 [data-node-view-content]')
.should('have.text', 'V2')

cy.get('[data-files-versions-versions-list] li > a').eq(2).click()
cy.get('[data-files-versions-versions-list] li a').eq(2).click()
cy.get('.viewer__content #read-only-editor')
.find('h1 [data-node-view-content]')
.should('have.text', 'V1')

cy.get('[data-files-versions-versions-list] li > a').eq(0).click()
cy.get('[data-files-versions-versions-list] li a').eq(0).click()
cy.getContent()
.find('h1 [data-node-view-content]')
.should('have.text', 'V3')
Expand All @@ -60,19 +60,19 @@ describe('Versions', () => {

cy.get('.app-sidebar-tabs__tab:contains("Versions")').click()

cy.get('[data-files-versions-versions-list] li > a').should('have.length', 3)
cy.get('[data-files-versions-versions-list] li a').should('have.length', 3)

cy.get('[data-files-versions-versions-list] li > a').eq(1).click()
cy.get('[data-files-versions-versions-list] li a').eq(1).click()
cy.get('.viewer__content #read-only-editor')
.find('h1 [data-node-view-content]')
.should('have.text', 'V2')

cy.get('[data-files-versions-versions-list] li > a').eq(2).click()
cy.get('[data-files-versions-versions-list] li a').eq(2).click()
cy.get('.viewer__content #read-only-editor')
.find('h1 [data-node-view-content]')
.should('have.text', 'V1')

cy.get('[data-files-versions-versions-list] li > a').eq(0).click()
cy.get('[data-files-versions-versions-list] li a').eq(0).click()
cy.getContent()
.find('h1 [data-node-view-content]')
.should('have.text', 'V3')
Expand All @@ -97,7 +97,7 @@ describe('Versions', () => {

cy.get('.app-sidebar-tabs__tab:contains("Versions")').click()

cy.get('[data-files-versions-versions-list] li > a').should('have.length', 3)
cy.get('[data-files-versions-versions-list] li a').should('have.length', 3)

cy.get('[data-files-versions-versions-list] li').eq(2)
.find('button.action-item__menutoggle').first().click({ force: true })
Expand Down
4 changes: 4 additions & 0 deletions cypress/support/e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ before(() => {
return false
}

if (err.message.includes('clearFocusTrap')) {
return false
}

return true
})
})
Expand Down

0 comments on commit 976b830

Please sign in to comment.