Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Allow custom query #358

Open
Open
Labels
featureNew feature or request
@cjoecker

Description

Summary 💡

Allow configuring a custom query so that screen.get... can be changed.

For that, I would create two new fields in the settings panel:
selector object with the default value screen
query prefix with the default value get

image

Examples 🌈

If the user can change the value to for example query prefix = getAll, then the testing-playground shows the query as screen.getAllBy...

If the user can change the value to for example selector object = await page, then the testing-playground shows the query as await page.getBy...

Motivation 🔦

Now with playwright using the testing-library queries, I need to rewrite the screen.getBy... to await page.getBy. I would like to automatize this task so that I need only to copy paste what test-playground gives me.
Also, when I know that I have many components using Jest, I need to rewrite screen.getBy... to screen.getAllBy...

If you like this proposal, I can submit a PR for that

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /