Skip to content

[Feature]: WebP format global configuration#42852

Description

馃殌 Feature Request

With the nice release of: https://playwright.dev/docs/release-notes#%EF%B8%8F-webp-screenshots

WebP format depends on await expect(page).toHaveScreenshot('homepage.webp'); extension being used in name. But it would be great if format could be defined in global configuration so that all screenshots use it.

Example

For example:

  expect: {
    toHaveScreenshot: {
      threshold: 0.1,
      maxDiffPixelRatio: 0.001,
      screenshotFormat: "webp",
    },
  },

Motivation

toHaveScreenshot() works also without providing the name. Seems inital implementation doesn't take that into consideration.

And to avoid hacks like:

pathTemplate: "./screenshots/{projectName}/{testName}{ext}",
->
pathTemplate: "./screenshots/{projectName}/{testName}.webp",

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions