-
Notifications
You must be signed in to change notification settings - Fork 11
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
window.TestingLibraryDom is undefined #31
Comments
Same for me, does not work with firefox but with chrome. |
Thanks for letting us know, PRs always welcome! |
Currently I cannot offer any support since I was just testing the library out. Just wanted to make sure this really is an issue, at least for more than one person. But if I used it, I would try my best to provide a PR that fixes this. |
I am also facing the same issue, Any update on fix? |
I'm no longer maintaining this project. If you make a PR I'll give you admin rights. 🙂 |
So I spent some time today investigating this issue. I was facing the same problems with the Testing-Dom library injection failing in Firefox in a team project. Based on the work done in testing-library/webdriverio-testing-library/issues/18 I was able to copy a workaround injection for firefox instances. This is the code segment that works:
I couldn't make a branch off of this repo (at least not one I couldn't push without seeing a 403 issue) so I made a fork instead with my work: I also tested out my solution in my other testing repo: I have not tested this extensively in other browsers except chrome but I suspect thanks to the line:
Other browsers are not effected by this new custom injection As mentioned in testing-library/webdriverio-testing-library/issues/18 if there is a better solution to injecting the dom script then adding a script element to the dom we should use that instead. It's still not clear why firefox is not executing the internal UMD script but its likely due to some firefox security check. Maybe this is configurable? Not sure, but this might be a good solution until someone finds a better workaround. |
Environment:
node v12.10.0
Package.json:
Error:
Using chrome is fine but in firefox I got this error above.
Test code:
The text was updated successfully, but these errors were encountered: