-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Support React Dev Tools #9656
Comments
Instead of saying |
thanks @pedroteixeira I wanted to get the redux dev tools to work with cypress and your comment helped solve the issue. So for anyone who might stumble upon this, here is what I did:
<script>
if (window.Cypress) {
window['__REDUX_DEVTOOLS_EXTENSION__'] =
window.parent['__REDUX_DEVTOOLS_EXTENSION__'];
window['__REDUX_DEVTOOLS_EXTENSION_COMPOSE__'] =
window.parent['__REDUX_DEVTOOLS_EXTENSION_COMPOSE__'];
}
</script>
|
I have got the extnesion installed, but it only wants to show components in the Cypress window not the iframe content. |
@technomage I've just checked the @pedroteixeira solution and it works perfectly! For the React DevTools, I've added
before che To check that everything works, I shared a simple cypress-react-devtools repository. Clone it and follow the instructions to check it the devtools work. |
I have tried @NoriSte 's fix, but it does not work for me. Searching for another solution. |
@interglobalmedia have you tried with the cypress-react-devtools repo too? |
I actually just found my app within Cypress React. I just had to dig down deep into the first FullApp component that appears in Chrome React DevTools after the Container component. And it is all there. I did check out your repo, but ended up not having to use it. This is a bad (and not complete) screen shot of where one's app being tested with Cypress resides. Shows how deep you have to go: |
I could not get react dev tools to "recognize" the React app running inside spec iframe with Cypress v4.5.0 and cypress-react-unit-test@4 |
Hi all. We just released Cypress 7.0, which comes with a completely revamped Component Testing experience. Component testing is no longer experimental (but still in alpha, with lots of updates and improvements coming in the next few weeks). Please let us know if you find any more issues. Updated Component Testing intro: https://docs.cypress.io/guides/component-testing/introduction Main updates:
Upgrading should not be too difficult, see the migration guide. To make sure Webpack 5 is working, I made a minimal example with [Babel + Webpack 5 + React + Cypress 7.x + One of the many improvements is the react devtools are now embedded in the runner. Note that they don't play super nicely with hot reload, sometimes you will need to cmd+R to force them to update, but it's still a big improvement over the existing solutions. Things will get better as we iterate. Anyone interested in this, please update to Cypress 7.0 using the migration guide and give it a try. Devtools support is getting better and will continue to do so 🎉 |
Closing as resolved. |
@jennifer-shehane sorry to comment on this old issue, but with the newest (10.x) versions of Cypress, are react devtools also included / supported? I'm having trouble using them. |
@piotrpalek It's not built in like the 9.x alpha had - those were quite buggy and had some known usability problems, so they are not shipped as part of Cypress 10 at this point. This might change if we can find a better way to support it. The main problem was setup/teardown between tests. They (react dev tools plugin) is not really designed to be constantly spun up and torn down in rapid succession, or have the components constantly changing in the way the do when tests are constantly mounting/unmounting components. In he future, I hope we can 1) support it in a more first class way and 2) expose some kind of API for people to build Cypress UI plugins (which could include some kind of bridge to communicate w/ the iframe and connect to things like React/Redux dev tools) at some point. As of 10.x the React dev tools are not shipped, but you should be able to still set it up with some effort (I definitely remember people working with Cypress + React Devtools prior to 7.x). |
Hello,
Adding the following in the mount function allows the React Dev Tools to work inside the iframe:
Perhaps it's useful for more people to have it by default.
The text was updated successfully, but these errors were encountered: