Skip to content

Commit

Permalink
tmp: use legacy selectors to open files in shares
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 27, 2023
1 parent e6d8da9 commit 96523eb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cypress/e2e/share.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ describe('Open test.md in viewer', function() {
return cy.visit(`/s/${token}`)
})
.then(() => {
cy.openFile('test.md')
cy.openFileInShare('test.md')
cy.getModal().getContent().should('be.visible')
cy.getModal().getContent().should('contain', 'Hello world')
cy.getModal().getContent().find('h2').should('contain', 'Hello world')
Expand Down
6 changes: 6 additions & 0 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,12 @@ Cypress.Commands.add('openFile', (fileName, params = {}) => {
cy.get(`[data-cy-files-list] tr[data-cy-files-list-row-name="${fileName}"] a[data-cy-files-list-row-name-link]`).click(params)
})

Cypress.Commands.add('openFileInShare', fileName => {
cy.get(`.files-fileList tr[data-file="${CSS.escape(fileName)}"] a.name`).click()
// eslint-disable-next-line
cy.wait(250)
})

Cypress.Commands.add('closeFile', (fileName, params = {}) => {
cy.intercept({ method: 'POST', url: '**/apps/text/session/close' })
.as('close')
Expand Down

0 comments on commit 96523eb

Please sign in to comment.