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

[Question]: Custom test id attr #21877

Closed
mturoci opened this issue Mar 22, 2023 · 4 comments
Closed

[Question]: Custom test id attr #21877

mturoci opened this issue Mar 22, 2023 · 4 comments

Comments

@mturoci
Copy link

mturoci commented Mar 22, 2023

Your question

I would like to configure custom date test attribute, but the docs seem to confuse me a bit. It shall be possible to specify via a test config (not able to find anything related to this, a hyperlink would solve this) or via playwright.selectors.set_test_id_attribute which is also not clear where it's coming from.

After a bit of digging, I found out the playwright obj is a fixture so maybe something that could be better described in the docs as well?

@mxschmitt mxschmitt transferred this issue from microsoft/playwright-python Mar 22, 2023
@mxschmitt
Copy link
Member

Yes, the docs are currently wrong for the language ports. In Python you can use e.g. the playwright fixture and use it to call playwright.selectors.set_test_id_attribute("..."). The easiest is to do it inside a session fixture with auto=true so its only done once when you are using pytest-playwright.

@mturoci
Copy link
Author

mturoci commented Mar 22, 2023

The easiest is to do it inside a session fixture with auto=true so its only done once when you are using pytest-playwright.

Yep, that's what I ended up doing.

Any plans on supporting a config similar to the JS counterpart though?

@mxschmitt
Copy link
Member

We have a feature request for it here: microsoft/playwright-pytest#69

@aslushnikov
Copy link
Collaborator

Merging into microsoft/playwright-pytest#69

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

No branches or pull requests

3 participants