support custom `testid` in the Chrome Extension
smeijer opened this issue Β· comments
Summary π‘
The title says it all.
Motivation π¦
https://twitter.com/wescopeland_/status/1275800945331441668?s=20
Hey!
Could I maybe have an example of a custom testId that the Chrome extension should support?
Thanks!
Every possible element attribute.
https://testing-library.com/docs/dom-testing-library/api-configuration
Ok, I got it. Thank you very much!
I could give it a shot.
I have two question about the implementation:
- should we enable this feature in
testing-playground
too? - if you have already thought about this: in order to retrieve the desired attribute to be used as
testId
should we add an input somewhere where the user could insert it?
-
Yes, I think we should keep the web version and the chrome version as equal as possible. That way a user could just copy/paste code from his tests (debug output) to the web version, and share the link with others to get some advice.
-
Yes, we would need an
input
. I have some idea's about the interface, but I haven't figured it out exactly. I think we need to add a settings modal similar to how react-devtools does it. The settings modal for the web version can follow later on, as long as the technical implementation (the id-attribute config) works on both.If we need a library for the modal, we can use
https://reacttraining.com/reach-ui/dialog
Ok, I think I have understood.
If it sounds good to you, I could start adding a settings modal to the extension in which a user could insert the attribute to be used as custom test id.
Sounds great @delca85.
@delca85, I'm working on an interface update to support a setting modal. So don't worry too much about where you're going to place that input
. Just focus on figuring out how we can configure testing-lib to apply that setting.
@smeijer, great! I have already implemented the functionality but I still have to apply style to the modal. If it's ok for you I could push tonight the code I have and later we could merge our work.
Sounds good to me @delca85
closed by #227