Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom query #358

Open
cjoecker opened this issue Oct 28, 2022 · 1 comment
Open

Allow custom query #358

cjoecker opened this issue Oct 28, 2022 · 1 comment
Labels
feature New feature or request

Comments

@cjoecker
Copy link

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

@cjoecker cjoecker added the feature New feature or request label Oct 28, 2022
@smeijer
Copy link
Member

smeijer commented Mar 3, 2023

Sorry, bit late, but I'd happily merge a pr that adds this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants