Skip to content

Commit

Permalink
fix(cypress): use updated file row selector
Browse files Browse the repository at this point in the history
Signed-off-by: Max <max@nextcloud.com>
  • Loading branch information
max-nextcloud committed Aug 21, 2023
1 parent aca0c3a commit 3866a5d
Show file tree
Hide file tree
Showing 6 changed files with 29,154 additions and 12,863 deletions.
12 changes: 5 additions & 7 deletions cypress/e2e/visual-regression.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,13 @@ describe('Visual regression tests ', function() {
cy.visit('/apps/files')
})
})
after(function() {
cy.logout()
})

it('See files in the list', function() {
cy.get('.files-fileList tr[data-file="test-card.mp4"]', { timeout: 10000 })
.should('contain', 'test-card.mp4')
cy.get('.files-fileList tr[data-file="test-card.png"]', { timeout: 10000 })
.should('contain', 'test-card.png')
// TODO: Do we care about the file name being split by a ' ' in the text property?
cy.getFile('test-card.mp4', { timeout: 10000 })
.should('contain', 'test-card .mp4')
cy.getFile('test-card.png', { timeout: 10000 })
.should('contain', 'test-card .png')
})

it('Open the viewer on file click', function() {
Expand Down
6 changes: 5 additions & 1 deletion cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,12 @@ Cypress.Commands.add('createFolder', (user, target) => {
})
})

Cypress.Commands.add('getFile', fileName => {
return cy.get(`[data-cy-files-list] tr[data-cy-files-list-row-name="${CSS.escape(fileName)}"]`)
})

Cypress.Commands.add('openFile', fileName => {
cy.get(`.files-fileList tr[data-file="${CSS.escape(fileName)}"] a.name`).click()
cy.getFile(fileName).click()
// eslint-disable-next-line
cy.wait(250)
})
Expand Down
2 changes: 1 addition & 1 deletion js/viewer-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -15766,4 +15766,4 @@ const computePosition = (reference, floating, options) => (0,_floating_ui_core__
/***/ })

}]);
//# sourceMappingURL=viewer-components.js.map?v=889c75db72f8d2c070d1
//# sourceMappingURL=viewer-components.js.map?v=dbbd6ead69671f790295
2 changes: 1 addition & 1 deletion js/viewer-components.js.map

Large diffs are not rendered by default.

0 comments on commit 3866a5d

Please sign in to comment.