Skip to content

[Feature]: define folders for test organisation within Playwright UI #32401

Open
@mikeybinns

Description

@mikeybinns

🚀 Feature Request

Add a way to override the folder structure of the UI to organise tests better and encourage co-location of test files.

Co-location of test files will become more important when Component testing is stable as adding the component test file in the same place as the component is a very natural way of organising this code, as opposed to end-to-end tests.

Example

My suggestion would be to add a folder override property to test.describe.configure to allow users to override the folder structure in the UI.

test.describe.configure({ folder: "folder/subfolder" });

These folders could be used to improve default folder structures or simply to organise test files into specific folders (e.g. visual tests / functional tests / performance tests).

Motivation

This will improve the UI mode of playwright to make it clearer and easier to use. Currently, in Playwright UI, tests are organised by their location folders. This works great if you just have 1 folder of tests, but not great if you prefer to keep test files alongside your code.

You can see in this example that there are many subfolders before I get to the test itself in the current system when I co-locate the test files with the files they test.
image

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