Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Visual Regression threshold change doesn't work. #325

Unanswered
Fy50167 asked this question in Q&A
Discussion options

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.

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /