Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions cypress/plugins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,10 @@
// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)

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

module.exports = (on) => {
}

module.exports = (on, config) => {

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 @@ -111,14 +108,3 @@ Cypress.Commands.add('deleteFile', fileName => {
cy.get(`#fileList tr[data-file="${fileName}"] a.name .action-menu`).click()
cy.get(`#fileList tr[data-file="${fileName}"] a.name + .popovermenu .action-delete`).click()
})

Cypress.Commands.overwrite('matchImageSnapshot', (originalFn, subject, name, options) => {
// hide avatar because random colour break the visual regression tests
cy.window().then(win => {
const avatarDiv = win.document.querySelector('.avatardiv')
if (avatarDiv) {
avatarDiv.remove()
}
})
return originalFn(subject, name, options)
})
Loading