Skip to content

Commit

Permalink
test: Adjust Cypress tests for new public share UI
Browse files Browse the repository at this point in the history
Signed-off-by: Ferdinand Thiessen <[email protected]>
  • Loading branch information
susnux committed Sep 6, 2024
1 parent 294c1b7 commit 1bb601f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cypress/e2e/sharing/download-share.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ describe(`Download ${fileName} from viewer in link share`, function() {
})

it('Open the viewer on file click', function() {
cy.openFileInShare('image1.jpg')
cy.openFile('image1.jpg')
cy.get('body > .viewer').should('be.visible')
})

Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/sharing/files-shares.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ describe('See shared folder with link share', function() {
})

it('Open the viewer on file click', function() {
cy.openFileInShare('image1.jpg')
cy.openFile('image1.jpg')
cy.get('body > .viewer').should('be.visible')
})

Expand Down
8 changes: 5 additions & 3 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { addCompareSnapshotCommand } from 'cypress-visual-regression/dist/comman
addCommands()
addCompareSnapshotCommand()

const url = Cypress.config('baseUrl').replace(/\/index.php\/?$/g, '')
const url = Cypress.config('baseUrl')!.replace(/\/index.php\/?$/g, '')
Cypress.env('baseUrl', url)

/**
Expand Down Expand Up @@ -97,8 +97,10 @@ Cypress.Commands.add('openFile', fileName => {
cy.wait(250)
})

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

0 comments on commit 1bb601f

Please sign in to comment.