Skip to content

[Feature]: Add --collapsed option for UI Mode test tree #41863

Description

@LukasLewandowski

🚀 Feature Request

When opening Playwright UI Mode for a large test suite, the test tree expands its first level by default.
This makes the sidebar noisy and harder to scan.

Add a --collapsed CLI option to start UI Mode with the test tree collapsed:
npx playwright test --ui --collapsed

Expected behavior:
All top-level test-tree items are initially collapsed.
The default behavior remains unchanged without the flag.
Users can still expand individual items or use “Expand all.”
The option should only be valid with UI Mode.

Example

Open UI mode with test tree collapsed using new flag npx playwright test --ui --collapsed

Motivation

Avoid not needed click to collapse all tests after opening UI mode. This will make UI mode tests tree less noisy and easier to scan.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions