Skip to content

[Feature]: out-of-the-box Playwright gallery #41996

Description

@jfgreffier

🚀 Feature Request

Playwright could provide story mounting out of the box. I'm just not clear what's the intent of the team: support frameworks officially, or at least few, or 100% rely on user land solutions.

Example

playwright/gallery/index.html

<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Playwright Component Gallery</title>
  </head>
  <body>
    <div id="root"></div>
    <script type="module" src="./main.tsx"></script>
  </body>
</html>

playwright/gallery/main.tsx

import 'playwright-gallery/react';

// Import styles, initialize component theme here.
// import '../src/common.css';

playwright-gallery/* would implement gallery-spec for React, Angular, and so on. It could be an official Playwright package.

Motivation

Playwright 1.62 just released that introduces component testing, out of experimental. The new solution centered around stories makes it easy to make a mount harness for any framework.

Playwright docs encourage the user to write this harness by themself with an AI agent. To me, it is not ideal developer experience. It takes time and tokens, is error prone, and users end-up having different experience depending on the AI agent implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions