-
-
Notifications
You must be signed in to change notification settings - Fork 22
-
Hello, this is my cypress.config.ts:
import { defineConfig } from 'cypress'
import fs from 'fs'
import { initPlugin } from '@frsource/cypress-plugin-visual-regression-diff/plugins'
export default defineConfig({
env: {
pluginVisualRegressionDiffConfig: { threshold: 0.03 }
},
e2e: {
setupNodeEvents(on, config) {
// Removes videos for tests that haven't failed
on(
'after:spec',
(spec: Cypress.Spec, results: CypressCommandLine.RunResult) => {
if (results && results.video) {
const failures = results.tests.some((test) =>
test.attempts.some((attempt) => attempt.state === 'failed')
)
if (!failures) {
fs.unlinkSync(results.video)
}
}
}
)
initPlugin(on, config)
},
baseUrl: 'http://localhost:3000',
defaultCommandTimeout: 28000,
video: true
},
trashAssetsBeforeRuns: false
})
When I run tests that use the matchImage command, the command still uses a regression threshold of 0.01 instead of 0.03. The same thing happens when I try to set the threshold directly within matchImage as well.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment