Skip to content

Commit

Permalink
fix(cy): use flexible selector for file list in Nextcloud 25-28
Browse files Browse the repository at this point in the history
Signed-off-by: Max <max@nextcloud.com>
  • Loading branch information
max-nextcloud committed Sep 4, 2023
1 parent bcd02cc commit 53886e3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cypress/e2e/apps.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('The apps', function() {

it('Renders the default files list', function() {
cy.login('jane', { route: 'apps/files' })
cy.get('.files-fileList tr').should('contain', 'welcome.txt')
cy.get('.files-fileList tr, .files-list__tbody tr').should('contain', 'welcome.txt')
})

})
Expand Down
15 changes: 8 additions & 7 deletions cypress/e2e/collective.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,16 @@ describe('Collective', function() {
cy.login('bob', { route: '/apps/files' })
})
it('has a matching folder', function() {
const fileListSelector = '.files-fileList'
const controlsSelector = '.files-controls'
const fileListSelector = '.files-fileList a, [data-cy-files-list-row] a'
const breadcrumbsSelector = '.files-controls .breadcrumb, [data-cy-files-content-breadcrumbs] a'
cy.get(fileListSelector).should('contain', 'Collectives')
cy.get(`${fileListSelector} a`).contains('Collectives').click()
cy.get(`${controlsSelector} .breadcrumb`).should('contain', 'Collectives')
cy.get(fileListSelector).contains('Collectives').click()
cy.get(breadcrumbsSelector).should('contain', 'Collectives')
cy.get(fileListSelector).should('contain', 'Preexisting Collective')
cy.get(`${fileListSelector} a`).contains('Preexisting Collective').click()
cy.get(`${controlsSelector} .breadcrumb`).should('contain', 'Preexisting Collective')
cy.get(fileListSelector).should('contain', 'Readme.md')
cy.get(fileListSelector).contains('Preexisting Collective').click()
cy.get(breadcrumbsSelector).should('contain', 'Preexisting Collective')
cy.get(fileListSelector).should('contain', 'Readme')
cy.get(fileListSelector).should('contain', '.md')
cy.get('.filelist-collectives-wrapper')
.should('contain', 'The content of this folder is best viewed in the Collectives app.')
})
Expand Down

0 comments on commit 53886e3

Please sign in to comment.