Skip to content

Commit

Permalink
Remove cypress-image-snapshot
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ <[email protected]>
  • Loading branch information
skjnldsv committed Apr 13, 2022
1 parent 92ae401 commit a14fac1
Show file tree
Hide file tree
Showing 17 changed files with 2,289 additions and 9,946 deletions.
4 changes: 0 additions & 4 deletions cypress/integration/delete.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,4 @@ describe('Delete image.png in viewer', function() {
cy.get('#fileList tr[data-file="image.png"]', { timeout: 10000 })
.should('not.exist')
})

it('Does not have any visual regression', function() {
// cy.matchImageSnapshot()
})
})
12 changes: 0 additions & 12 deletions cypress/integration/download-share-disabled.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ describe(`Download ${fileName} in viewer`, function() {
cy.get('#fileList tr').should('contain', 'Photos')
})

it('Does not have any visual regression 1', function() {
// cy.matchImageSnapshot()
})

it('See shared files in the list', function() {
cy.openFile('Photos')
cy.get('#fileList tr[data-file="image1.jpg"]', { timeout: 10000 })
Expand All @@ -64,10 +60,6 @@ describe(`Download ${fileName} in viewer`, function() {
.should('contain', 'image2.jpg')
})

it('Does not have any visual regression 2', function() {
// cy.matchImageSnapshot()
})

it('Share the Photos folder with a share link and access the share link', function() {
cy.createLinkShare('/Photos').then(token => {
// Open the sidebar
Expand All @@ -86,10 +78,6 @@ describe(`Download ${fileName} in viewer`, function() {
})
})

it('Does not have any visual regression 3', function() {
// cy.matchImageSnapshot()
})

it('Open the viewer on file click', function() {
cy.openFile('image1.jpg')
cy.get('body > .viewer').should('be.visible')
Expand Down
12 changes: 0 additions & 12 deletions cypress/integration/download-share.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ describe(`Download ${fileName} from viewer in link share`, function() {
cy.get('#fileList tr').should('contain', 'Photos')
})

it('Does not have any visual regression 1', function() {
// cy.matchImageSnapshot()
})

it('See shared files in the list', function() {
cy.openFile('Photos')
cy.get('#fileList tr[data-file="image1.jpg"]', { timeout: 10000 })
Expand All @@ -63,21 +59,13 @@ describe(`Download ${fileName} from viewer in link share`, function() {
.should('contain', 'image2.jpg')
})

it('Does not have any visual regression 2', function() {
// cy.matchImageSnapshot()
})

it('Share the Photos folder with a share link and access the share link', function() {
cy.createLinkShare('/Photos').then(token => {
cy.logout()
cy.visit(`/s/${token}`)
})
})

it('Does not have any visual regression 3', function() {
// cy.matchImageSnapshot()
})

it('Open the viewer on file click', function() {
cy.openFile('image1.jpg')
cy.get('body > .viewer').should('be.visible')
Expand Down
36 changes: 0 additions & 36 deletions cypress/integration/files-shares.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ describe('See shared folder with link share', function() {
cy.get('#fileList tr').should('contain', 'Photos')
})

it('Does not have any visual regression 1', function() {
// cy.matchImageSnapshot()
})

it('See shared files in the list', function() {
cy.openFile('Photos')
cy.get('#fileList tr[data-file="image1.jpg"]', { timeout: 10000 })
Expand All @@ -69,21 +65,13 @@ describe('See shared folder with link share', function() {
.should('contain', 'video1.mp4')
})

it('Does not have any visual regression 2', function() {
// cy.matchImageSnapshot()
})

it('Share the Photos folder with a share link and access the share link', function() {
cy.createLinkShare('/Photos').then(token => {
cy.logout()
cy.visit(`/s/${token}`)
})
})

it('Does not have any visual regression 3', function() {
// cy.matchImageSnapshot()
})

it('Open the viewer on file click', function() {
cy.openFile('image1.jpg')
cy.get('body > .viewer').should('be.visible')
Expand All @@ -108,10 +96,6 @@ describe('See shared folder with link share', function() {
cy.get('body > .viewer a.next').should('be.visible')
})

it('Does not have any visual regression 4', function() {
// cy.matchImageSnapshot()
})

it('Show image2 on next', function() {
cy.get('body > .viewer a.next').click()
cy.get('body > .viewer .modal-container img').should('have.length', 3)
Expand All @@ -126,10 +110,6 @@ describe('See shared folder with link share', function() {
.and('not.have.class', 'icon-loading')
})

it('Does not have any visual regression 5', function() {
// cy.matchImageSnapshot()
})

it('Show image3 on next', function() {
cy.get('body > .viewer a.next').click()
cy.get('body > .viewer .modal-container img').should('have.length', 3)
Expand All @@ -144,10 +124,6 @@ describe('See shared folder with link share', function() {
.and('not.have.class', 'icon-loading')
})

it('Does not have any visual regression 6', function() {
// cy.matchImageSnapshot()
})

it('Show image4 on next', function() {
cy.get('body > .viewer a.next').click()
cy.get('body > .viewer .modal-container img').should('have.length', 2)
Expand All @@ -162,10 +138,6 @@ describe('See shared folder with link share', function() {
.and('not.have.class', 'icon-loading')
})

it('Does not have any visual regression 7', function() {
// cy.matchImageSnapshot()
})

it('Show video1 on next', function() {
cy.get('body > .viewer a.next').click()
// only 2 because we don't know if we're at the end of the slideshow, current vid and prev img
Expand All @@ -183,10 +155,6 @@ describe('See shared folder with link share', function() {
.and('not.have.class', 'icon-loading')
})

it('Does not have any visual regression 8', function() {
// cy.matchImageSnapshot()
})

it('Show image1 again on next', function() {
cy.get('body > .viewer a.next').click()
cy.get('body > .viewer .modal-container img').should('have.length', 2)
Expand All @@ -200,8 +168,4 @@ describe('See shared folder with link share', function() {
.and('have.class', 'modal-mask')
.and('not.have.class', 'icon-loading')
})

it('Does not have any visual regression 9', function() {
// cy.matchImageSnapshot()
})
})
4 changes: 0 additions & 4 deletions cypress/integration/image-small.png.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,4 @@ describe('Open image-small.png in viewer', function() {
cy.get('body > .viewer a.prev').should('not.be.visible')
cy.get('body > .viewer a.next').should('not.be.visible')
})

it('Does not have any visual regression', function() {
// cy.matchImageSnapshot()
})
})
4 changes: 0 additions & 4 deletions cypress/integration/image.png.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,4 @@ describe('Open image.png in viewer', function() {
cy.get('body > .viewer a.prev').should('not.be.visible')
cy.get('body > .viewer a.next').should('not.be.visible')
})

it('Does not have any visual regression', function() {
// cy.matchImageSnapshot()
})
})
4 changes: 0 additions & 4 deletions cypress/integration/image.svg.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,4 @@ describe('Open image.svg in viewer', function() {
.should('have.attr', 'src')
.should('contain', 'data:image/svg+xml;base64')
})

it('Does not have any visual regression', function() {
// cy.matchImageSnapshot()
})
})
4 changes: 0 additions & 4 deletions cypress/integration/image.webp.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,4 @@ describe('Open image.webp in viewer', function() {
cy.get('body > .viewer a.prev').should('not.be.visible')
cy.get('body > .viewer a.next').should('not.be.visible')
})

it('Does not have any visual regression', function() {
cy.matchImageSnapshot()
})
})
20 changes: 0 additions & 20 deletions cypress/integration/images-custom-list-loadmore.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,6 @@ describe('Open custom list of images in viewer with pagination', function() {
cy.get('body > .viewer a.next').should('be.visible')
})

it('Does not have any visual regression 1', function() {
// cy.matchImageSnapshot()
})

it('Show image2 on next', function() {
cy.get('body > .viewer a.next').click()
cy.get('body > .viewer .modal-container img').should('have.length', 2)
Expand All @@ -164,10 +160,6 @@ describe('Open custom list of images in viewer with pagination', function() {
.and('not.have.class', 'icon-loading')
})

it('Does not have any visual regression 2', function() {
// cy.matchImageSnapshot()
})

it('Show image3 on next', function() {
cy.get('body > .viewer a.next').click()
cy.get('body > .viewer .modal-container img').should('have.length', 3)
Expand All @@ -182,10 +174,6 @@ describe('Open custom list of images in viewer with pagination', function() {
.and('not.have.class', 'icon-loading')
})

it('Does not have any visual regression 3', function() {
// cy.matchImageSnapshot()
})

it('Show image4 on next', function() {
cy.get('body > .viewer a.next').click()
cy.get('body > .viewer .modal-container img').should('have.length', 2)
Expand All @@ -200,10 +188,6 @@ describe('Open custom list of images in viewer with pagination', function() {
.and('not.have.class', 'icon-loading')
})

it('Does not have any visual regression 4', function() {
// cy.matchImageSnapshot()
})

it('Show image1 again on next', function() {
cy.get('body > .viewer a.next').click()
cy.get('body > .viewer .modal-container img').should('have.length', 2)
Expand All @@ -217,8 +201,4 @@ describe('Open custom list of images in viewer with pagination', function() {
.and('have.class', 'modal-mask')
.and('not.have.class', 'icon-loading')
})

it('Does not have any visual regression 5', function() {
// cy.matchImageSnapshot()
})
})
12 changes: 0 additions & 12 deletions cypress/integration/images-custom-list.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,6 @@ describe('Open custom images list in viewer', function() {
cy.get('body > .viewer a.next').should('be.visible')
})

it('Does not have any visual regression 1', function() {
// cy.matchImageSnapshot()
})

it('Show image3 on next', function() {
cy.get('body > .viewer a.next').click()
cy.get('body > .viewer .modal-container img').should('have.length', 2)
Expand All @@ -135,10 +131,6 @@ describe('Open custom images list in viewer', function() {
cy.get('body > .viewer .modal-header button.header-close').should('be.visible')
})

it('Does not have any visual regression 2', function() {
// cy.matchImageSnapshot()
})

it('Show image1 on next', function() {
cy.get('body > .viewer a.next').click()
cy.get('body > .viewer .modal-container img').should('have.length', 2)
Expand All @@ -158,8 +150,4 @@ describe('Open custom images list in viewer', function() {
cy.get('body > .viewer .modal-header button.action-item__menutoggle').should('be.visible')
cy.get('body > .viewer .modal-header button.header-close').should('be.visible')
})

it('Does not have any visual regression 3', function() {
// cy.matchImageSnapshot()
})
})
20 changes: 0 additions & 20 deletions cypress/integration/images.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@ describe('Open images in viewer', function() {
cy.get('body > .viewer a.next').should('be.visible')
})

it('Does not have any visual regression 1', function() {
// cy.matchImageSnapshot()
})

it('Show image2 on next', function() {
cy.get('body > .viewer a.next').click()
cy.get('body > .viewer .modal-container img').should('have.length', 3)
Expand All @@ -98,10 +94,6 @@ describe('Open images in viewer', function() {
.and('not.have.class', 'icon-loading')
})

it('Does not have any visual regression 2', function() {
// cy.matchImageSnapshot()
})

it('Show image3 on next', function() {
cy.get('body > .viewer a.next').click()
cy.get('body > .viewer .modal-container img').should('have.length', 3)
Expand All @@ -116,10 +108,6 @@ describe('Open images in viewer', function() {
.and('not.have.class', 'icon-loading')
})

it('Does not have any visual regression 3', function() {
// cy.matchImageSnapshot()
})

it('Show image4 on next', function() {
cy.get('body > .viewer a.next').click()
// only 2 because we don't know if we're at the end of the slideshow, current img and previous one
Expand All @@ -135,10 +123,6 @@ describe('Open images in viewer', function() {
.and('not.have.class', 'icon-loading')
})

it('Does not have any visual regression 4', function() {
// cy.matchImageSnapshot()
})

it('Show image1 again on next', function() {
cy.get('body > .viewer a.next').click()
cy.get('body > .viewer .modal-container img').should('have.length', 2)
Expand All @@ -152,8 +136,4 @@ describe('Open images in viewer', function() {
.and('have.class', 'modal-mask')
.and('not.have.class', 'icon-loading')
})

it('Does not have any visual regression 5', function() {
// cy.matchImageSnapshot()
})
})
3 changes: 0 additions & 3 deletions cypress/plugins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@
// the project's config changing)

const browserify = require('@cypress/browserify-preprocessor')
const { addMatchImageSnapshotPlugin } = require('cypress-image-snapshot/plugin')

module.exports = (on, config) => {
// Fix browserslist extend https://github.com/cypress-io/cypress/issues/2983#issuecomment-570616682
on('file:preprocessor', browserify())

addMatchImageSnapshotPlugin(on, config)
}
14 changes: 0 additions & 14 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,8 @@
*
*/

import { addMatchImageSnapshotCommand } from 'cypress-image-snapshot/command'
import axios from '@nextcloud/axios'

addMatchImageSnapshotCommand()

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

Expand Down Expand Up @@ -159,14 +156,3 @@ Cypress.Commands.add('createLinkShare', path => {
}
}).should('have.length', 15)
})

Cypress.Commands.overwrite('matchImageSnapshot', (originalFn, subject, name, options) => {
// hide avatar because random colour break the visual regression tests
cy.window().then(window => {
const avatarDiv = window.document.querySelector('.avatardiv')
if (avatarDiv) {
avatarDiv.remove()
}
})
return originalFn(subject, name, options)
})
4 changes: 2 additions & 2 deletions js/viewer-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/viewer-main.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit a14fac1

Please sign in to comment.