Skip to content

Commit

Permalink
Adjust cypress tests to match next/prev buttons
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliushaertl committed Aug 12, 2022
1 parent 2efc9e4 commit 728881a
Show file tree
Hide file tree
Showing 19 changed files with 94 additions and 94 deletions.
4 changes: 2 additions & 2 deletions cypress/e2e/audio.mpeg.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ describe('Open audio.mp3 in viewer', function() {
})

it('Does not see navigation arrows', function() {
cy.get('body > .viewer a.prev').should('not.be.visible')
cy.get('body > .viewer a.next').should('not.be.visible')
cy.get('body > .viewer button.prev').should('not.be.visible')
cy.get('body > .viewer button.next').should('not.be.visible')
})

it('Take screenshot', function() {
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/audio.ogg.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ describe('Open audio.ogg in viewer', function() {
})

it('Does not see navigation arrows', function() {
cy.get('body > .viewer a.prev').should('not.be.visible')
cy.get('body > .viewer a.next').should('not.be.visible')
cy.get('body > .viewer button.prev').should('not.be.visible')
cy.get('body > .viewer button.next').should('not.be.visible')
})

it('Take screenshot', function() {
Expand Down
10 changes: 5 additions & 5 deletions cypress/e2e/audios.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ describe('Open mp3 and ogg audio in viewer', function() {
cy.get('body > .viewer .modal-container .viewer__file.viewer__file--active audio')
.should('have.attr', 'src')
.and('contain', `/remote.php/dav/files/${randUser}/audio.mp3`)
cy.get('body > .viewer a.next').should('be.visible')
cy.get('body > .viewer a.next').should('be.visible')
cy.get('body > .viewer button.next').should('be.visible')
cy.get('body > .viewer button.next').should('be.visible')
})

it('Does not see a loading animation', function() {
Expand All @@ -80,13 +80,13 @@ describe('Open mp3 and ogg audio in viewer', function() {
})

it('Show audio.ogg on next', function() {
cy.get('body > .viewer a.next').click()
cy.get('body > .viewer button.next').click()
cy.get('body > .viewer .modal-container audio').should('have.length', 2)
cy.get('body > .viewer .modal-container .viewer__file.viewer__file--active audio')
.should('have.attr', 'src')
.and('contain', `/remote.php/dav/files/${randUser}/audio.ogg`)
cy.get('body > .viewer a.prev').should('be.visible')
cy.get('body > .viewer a.next').should('be.visible')
cy.get('body > .viewer button.prev').should('be.visible')
cy.get('body > .viewer button.next').should('be.visible')
})

it('Does not see a loading animation', function() {
Expand Down
34 changes: 17 additions & 17 deletions cypress/e2e/files-shares.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,15 @@ describe('See shared folder with link share', function() {
it('Does see next navigation arrows', function() {
cy.get('body > .viewer .modal-container img').should('have.length', 2)
cy.get('body > .viewer .modal-container img').should('have.attr', 'src')
cy.get('body > .viewer a.next').should('be.visible')
cy.get('body > .viewer a.next').should('be.visible')
cy.get('body > .viewer button.next').should('be.visible')
cy.get('body > .viewer button.next').should('be.visible')
})

it('Show image2 on next', function() {
cy.get('body > .viewer a.next').click()
cy.get('body > .viewer button.next').click()
cy.get('body > .viewer .modal-container img').should('have.length', 3)
cy.get('body > .viewer a.prev').should('be.visible')
cy.get('body > .viewer a.next').should('be.visible')
cy.get('body > .viewer button.prev').should('be.visible')
cy.get('body > .viewer button.next').should('be.visible')
})

it('Does not see a loading animation', function() {
Expand All @@ -111,10 +111,10 @@ describe('See shared folder with link share', function() {
})

it('Show image3 on next', function() {
cy.get('body > .viewer a.next').click()
cy.get('body > .viewer button.next').click()
cy.get('body > .viewer .modal-container img').should('have.length', 3)
cy.get('body > .viewer a.prev').should('be.visible')
cy.get('body > .viewer a.next').should('be.visible')
cy.get('body > .viewer button.prev').should('be.visible')
cy.get('body > .viewer button.next').should('be.visible')
})

it('Does not see a loading animation', function() {
Expand All @@ -125,10 +125,10 @@ describe('See shared folder with link share', function() {
})

it('Show image4 on next', function() {
cy.get('body > .viewer a.next').click()
cy.get('body > .viewer button.next').click()
cy.get('body > .viewer .modal-container img').should('have.length', 2)
cy.get('body > .viewer a.prev').should('be.visible')
cy.get('body > .viewer a.next').should('be.visible')
cy.get('body > .viewer button.prev').should('be.visible')
cy.get('body > .viewer button.next').should('be.visible')
})

it('Does not see a loading animation', function() {
Expand All @@ -139,12 +139,12 @@ describe('See shared folder with link share', function() {
})

it('Show video1 on next', function() {
cy.get('body > .viewer a.next').click()
cy.get('body > .viewer button.next').click()
// only 2 because we don't know if we're at the end of the slideshow, current vid and prev img
cy.get('body > .viewer .modal-container img').should('have.length', 1)
cy.get('body > .viewer .modal-container video').should('have.length', 1)
cy.get('body > .viewer a.prev').should('be.visible')
cy.get('body > .viewer a.next').should('be.visible')
cy.get('body > .viewer button.prev').should('be.visible')
cy.get('body > .viewer button.next').should('be.visible')
cy.get('body > .viewer .modal-title').should('contain', 'video1.mp4')
})

Expand All @@ -156,10 +156,10 @@ describe('See shared folder with link share', function() {
})

it('Show image1 again on next', function() {
cy.get('body > .viewer a.next').click()
cy.get('body > .viewer button.next').click()
cy.get('body > .viewer .modal-container img').should('have.length', 2)
cy.get('body > .viewer a.prev').should('be.visible')
cy.get('body > .viewer a.next').should('be.visible')
cy.get('body > .viewer button.prev').should('be.visible')
cy.get('body > .viewer button.next').should('be.visible')
})

it('Does not see a loading animation', function() {
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/image-small.png.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('Open image-small.png in viewer', function() {
})

it('Does not see navigation arrows', function() {
cy.get('body > .viewer a.prev').should('not.be.visible')
cy.get('body > .viewer a.next').should('not.be.visible')
cy.get('body > .viewer button.prev').should('not.be.visible')
cy.get('body > .viewer button.next').should('not.be.visible')
})
})
4 changes: 2 additions & 2 deletions cypress/e2e/image.gif.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ describe('Open image.gif in viewer', function() {
})

it('Does not see navigation arrows', function() {
cy.get('body > .viewer a.prev').should('not.be.visible')
cy.get('body > .viewer a.next').should('not.be.visible')
cy.get('body > .viewer button.prev').should('not.be.visible')
cy.get('body > .viewer button.next').should('not.be.visible')
})

it('Take screenshot', function() {
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/image.png.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('Open image.png in viewer', function() {
})

it('Does not see navigation arrows', function() {
cy.get('body > .viewer a.prev').should('not.be.visible')
cy.get('body > .viewer a.next').should('not.be.visible')
cy.get('body > .viewer button.prev').should('not.be.visible')
cy.get('body > .viewer button.next').should('not.be.visible')
})
})
4 changes: 2 additions & 2 deletions cypress/e2e/image.svg.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ describe('Open image.svg in viewer', function() {
})

it('Does not see navigation arrows', function() {
cy.get('body > .viewer a.prev').should('not.be.visible')
cy.get('body > .viewer a.next').should('not.be.visible')
cy.get('body > .viewer button.prev').should('not.be.visible')
cy.get('body > .viewer button.next').should('not.be.visible')
})

it('Have the base64 encoded value of the svg', function() {
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/image.webp.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('Open image.webp in viewer', function() {
})

it('Does not see navigation arrows', function() {
cy.get('body > .viewer a.prev').should('not.be.visible')
cy.get('body > .viewer a.next').should('not.be.visible')
cy.get('body > .viewer button.prev').should('not.be.visible')
cy.get('body > .viewer button.next').should('not.be.visible')
})
})
28 changes: 14 additions & 14 deletions cypress/e2e/images-custom-list-loadmore.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,15 @@ describe('Open custom list of images in viewer with pagination', function() {
it('Does see next navigation arrows', function() {
cy.get('body > .viewer .modal-container img').should('have.length', 2)
cy.get('body > .viewer .modal-container img').should('have.attr', 'src')
cy.get('body > .viewer a.next').should('be.visible')
cy.get('body > .viewer a.next').should('be.visible')
cy.get('body > .viewer button.next').should('be.visible')
cy.get('body > .viewer button.next').should('be.visible')
})

it('Show image2 on next', function() {
cy.get('body > .viewer a.next').click()
cy.get('body > .viewer button.next').click()
cy.get('body > .viewer .modal-container img').should('have.length', 2)
cy.get('body > .viewer a.prev').should('be.visible')
cy.get('body > .viewer a.next').should('be.visible')
cy.get('body > .viewer button.prev').should('be.visible')
cy.get('body > .viewer button.next').should('be.visible')
})

it('Does not see a loading animation', function() {
Expand All @@ -161,10 +161,10 @@ describe('Open custom list of images in viewer with pagination', function() {
})

it('Show image3 on next', function() {
cy.get('body > .viewer a.next').click()
cy.get('body > .viewer button.next').click()
cy.get('body > .viewer .modal-container img').should('have.length', 3)
cy.get('body > .viewer a.prev').should('be.visible')
cy.get('body > .viewer a.next').should('be.visible')
cy.get('body > .viewer button.prev').should('be.visible')
cy.get('body > .viewer button.next').should('be.visible')
})

it('Does not see a loading animation', function() {
Expand All @@ -175,10 +175,10 @@ describe('Open custom list of images in viewer with pagination', function() {
})

it('Show image4 on next', function() {
cy.get('body > .viewer a.next').click()
cy.get('body > .viewer button.next').click()
cy.get('body > .viewer .modal-container img').should('have.length', 2)
cy.get('body > .viewer a.prev').should('be.visible')
cy.get('body > .viewer a.next').should('be.visible')
cy.get('body > .viewer button.prev').should('be.visible')
cy.get('body > .viewer button.next').should('be.visible')
})

it('Does not see a loading animation', function() {
Expand All @@ -189,10 +189,10 @@ describe('Open custom list of images in viewer with pagination', function() {
})

it('Show image1 again on next', function() {
cy.get('body > .viewer a.next').click()
cy.get('body > .viewer button.next').click()
cy.get('body > .viewer .modal-container img').should('have.length', 2)
cy.get('body > .viewer a.prev').should('be.visible')
cy.get('body > .viewer a.next').should('be.visible')
cy.get('body > .viewer button.prev').should('be.visible')
cy.get('body > .viewer button.next').should('be.visible')
})

it('Does not see a loading animation', function() {
Expand Down
16 changes: 8 additions & 8 deletions cypress/e2e/images-custom-list.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,15 @@ describe('Open custom images list in viewer', function() {
it('Does see next navigation arrows', function() {
cy.get('body > .viewer .modal-container img').should('have.length', 2)
cy.get('body > .viewer .modal-container img').should('have.attr', 'src')
cy.get('body > .viewer a.next').should('be.visible')
cy.get('body > .viewer a.next').should('be.visible')
cy.get('body > .viewer button.next').should('be.visible')
cy.get('body > .viewer button.next').should('be.visible')
})

it('Show image3 on next', function() {
cy.get('body > .viewer a.next').click()
cy.get('body > .viewer button.next').click()
cy.get('body > .viewer .modal-container img').should('have.length', 2)
cy.get('body > .viewer a.prev').should('be.visible')
cy.get('body > .viewer a.next').should('be.visible')
cy.get('body > .viewer button.prev').should('be.visible')
cy.get('body > .viewer button.next').should('be.visible')
})

it('Does not see a loading animation', function() {
Expand All @@ -132,10 +132,10 @@ describe('Open custom images list in viewer', function() {
})

it('Show image1 on next', function() {
cy.get('body > .viewer a.next').click()
cy.get('body > .viewer button.next').click()
cy.get('body > .viewer .modal-container img').should('have.length', 2)
cy.get('body > .viewer a.prev').should('be.visible')
cy.get('body > .viewer a.next').should('be.visible')
cy.get('body > .viewer button.prev').should('be.visible')
cy.get('body > .viewer button.next').should('be.visible')
})

it('Does not see a loading animation', function() {
Expand Down
28 changes: 14 additions & 14 deletions cypress/e2e/images.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ describe('Open images in viewer', function() {
// only 2 because we don't know if we're at the end of the slideshow, current img and next one
cy.get('body > .viewer .modal-container img').should('have.length', 2)
cy.get('body > .viewer .modal-container img').should('have.attr', 'src')
cy.get('body > .viewer a.next').should('be.visible')
cy.get('body > .viewer a.next').should('be.visible')
cy.get('body > .viewer button.next').should('be.visible')
cy.get('body > .viewer button.next').should('be.visible')
})

it('Show image2 on next', function() {
cy.get('body > .viewer a.next').click()
cy.get('body > .viewer button.next').click()
cy.get('body > .viewer .modal-container img').should('have.length', 3)
cy.get('body > .viewer a.prev').should('be.visible')
cy.get('body > .viewer a.next').should('be.visible')
cy.get('body > .viewer button.prev').should('be.visible')
cy.get('body > .viewer button.next').should('be.visible')
})

it('Does not see a loading animation', function() {
Expand All @@ -95,10 +95,10 @@ describe('Open images in viewer', function() {
})

it('Show image3 on next', function() {
cy.get('body > .viewer a.next').click()
cy.get('body > .viewer button.next').click()
cy.get('body > .viewer .modal-container img').should('have.length', 3)
cy.get('body > .viewer a.prev').should('be.visible')
cy.get('body > .viewer a.next').should('be.visible')
cy.get('body > .viewer button.prev').should('be.visible')
cy.get('body > .viewer button.next').should('be.visible')
})

it('Does not see a loading animation', function() {
Expand All @@ -109,11 +109,11 @@ describe('Open images in viewer', function() {
})

it('Show image4 on next', function() {
cy.get('body > .viewer a.next').click()
cy.get('body > .viewer button.next').click()
// only 2 because we don't know if we're at the end of the slideshow, current img and previous one
cy.get('body > .viewer .modal-container img').should('have.length', 2)
cy.get('body > .viewer a.prev').should('be.visible')
cy.get('body > .viewer a.next').should('be.visible')
cy.get('body > .viewer button.prev').should('be.visible')
cy.get('body > .viewer button.next').should('be.visible')
})

it('Does not see a loading animation', function() {
Expand All @@ -124,10 +124,10 @@ describe('Open images in viewer', function() {
})

it('Show image1 again on next', function() {
cy.get('body > .viewer a.next').click()
cy.get('body > .viewer button.next').click()
cy.get('body > .viewer .modal-container img').should('have.length', 2)
cy.get('body > .viewer a.prev').should('be.visible')
cy.get('body > .viewer a.next').should('be.visible')
cy.get('body > .viewer button.prev').should('be.visible')
cy.get('body > .viewer button.next').should('be.visible')
})

it('Does not see a loading animation', function() {
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/oddname/oddname.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ export default function(file, type) {
}

function arrowsOK() {
cy.get('body > .viewer a.prev').should('not.be.visible')
cy.get('body > .viewer a.next').should('not.be.visible')
cy.get('body > .viewer button.prev').should('not.be.visible')
cy.get('body > .viewer button.next').should('not.be.visible')
}

it(`See ${file} as ${placedName} in the list`, function() {
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/video.mkv.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ describe('Open video.mkv in viewer', function() {
})

it('Does not see navigation arrows', function() {
cy.get('body > .viewer a.prev').should('not.be.visible')
cy.get('body > .viewer a.next').should('not.be.visible')
cy.get('body > .viewer button.prev').should('not.be.visible')
cy.get('body > .viewer button.next').should('not.be.visible')
})

it('Take screenshot', function() {
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/video.mp4.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ describe('Open video1.mp4 in viewer', function() {
})

it('Does not see navigation arrows', function() {
cy.get('body > .viewer a.prev').should('not.be.visible')
cy.get('body > .viewer a.next').should('not.be.visible')
cy.get('body > .viewer button.prev').should('not.be.visible')
cy.get('body > .viewer button.next').should('not.be.visible')
})

it('Take screenshot', function() {
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/video.ogv.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ describe('Open video.ogv in viewer', function() {
})

it('Does not see navigation arrows', function() {
cy.get('body > .viewer a.prev').should('not.be.visible')
cy.get('body > .viewer a.next').should('not.be.visible')
cy.get('body > .viewer button.prev').should('not.be.visible')
cy.get('body > .viewer button.next').should('not.be.visible')
})

it('Take screenshot', function() {
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/video.webm.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ describe('Open video.webm in viewer', function() {
})

it('Does not see navigation arrows', function() {
cy.get('body > .viewer a.prev').should('not.be.visible')
cy.get('body > .viewer a.next').should('not.be.visible')
cy.get('body > .viewer button.prev').should('not.be.visible')
cy.get('body > .viewer button.next').should('not.be.visible')
})

it('Take screenshot', function() {
Expand Down
Loading

0 comments on commit 728881a

Please sign in to comment.