Skip to content

[Feature]: clarify maxDiffPixels override in logging in case of failure #38116

@fdm-mateco

Description

@fdm-mateco

🚀 Feature Request

When there is a global override for maxDiffPixels, it should be mentioned in the logs when toHaveScreenshot fails, as this is what's being used. See example below.

Example

In playwright.config.ts:

expect: {
    timeout: 5000,
    toHaveScreenshot: {
      maxDiffPixels: 1
    }
  },

In a test:
await expect(locator).toHaveScreenshot('calendar.png', { maxDiffPixelRatio: 0.02 });

Currently: in case of failure, the logging will say:

Image

Expected: the logging mentions the global override somehow

Motivation

Avoid confusion, make it clear what has actually been compared.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions