Skip to content

[Feature]: Ability to take screenshots during codegen #31128

Open
@kotosha-real

Description

@kotosha-real

🚀 Feature Request

The additional button on the action overlay to take a screenshot of the current viewport. The action overlay is shown in the image below:

Screenshot of the Playwright codegen action overlay

I expect this button to generate the line await expect(page).toHaveScreenshot().

Example

  1. Run codegen
  2. Mess around until you get the state you want to capture
  3. Click the button on the action overlay to take a screenshot

Motivation

This can eliminate the need to edit the generated test cases and make codegen a truly generative tool, with no need to add anything by hand afterwards. This could save a lot of time in some scenarios. Also, screenshots is a very basic tool that is widely used in Playwright, so the lack of it in codegen doesn't make sense.

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