Comments (11)
Thanks @FDiskas for sharing the repo. I will take a look.
from cypress-react-selector.
Hi all, grant my apologies for not getting actively involved in the NextJs support for this library. I am having real busy weeks with Postman for some critical releases. I will not be able to take this task for another month. I would really appreciate if I get support in this. PRs are always welcome.
Thanks again for the love!
Cheers!
from cypress-react-selector.
hi @FDiskas , thanks for using the library. Have you tried defining the configuration as stated here?
from cypress-react-selector.
Sure. I used env settings
{
"env": {
"cypress-react-selector": {
"root": "#root"
}
}
}
from cypress-react-selector.
Hi @FDiskas , it is possible that the react root css selector is not #root
. Can you check if this is something else?
from cypress-react-selector.
I was testing on this repo
https://github.com/FDiskas/devtalks-e2e/tree/cypress
Nexjs root is __next
and im sure that it matched setting in my test
from cypress-react-selector.
Hi, is there any update on this issue? Our project also use next.js and cypress. Error says Component not found
from cypress-react-selector.
I also had a similar issue in nextjs
. For me, what solved it, was to perform an ordinary get
on one of the parent elements of the component, then applying the react
method.
For example, I had a modal popup that had a data-test id applied to it. I would then alias this element, then use it to fetch the react component:
cy.get(`[data-test="modal-popup"]`).as("modal");
cy.get("@modal").react("TargetComponent");
Can anyone confirm if this works on their end?
Also, setting or not setting the root env variable had not effect on the runnig of the test (perhaps connected to #236)
from cypress-react-selector.
I played around a bit. I found issue #251. I also found that a minified build had no problems finding a React instance, but an unminified build did. Is Next.js doing something odd?
resq
looks for keys/properties on the React root HTML element, either _reactRootContainer
or something beginning with _reactInternalInstance
or _reactFiber
. Stepping through in a debugger, the HTML element has no iterable keys. 🤷♂️
from cypress-react-selector.
Hi @bkirove, as this PR is merged and a new version of resq is released, can you give it a try for this problem?
If all good, can release a version of cypress-react-selector.
from cypress-react-selector.
I updated the test project https://github.com/FDiskas/devtalks-e2e/tree/cypress with all dependencies as the newest
Still didn't manage to work it properly - the same error
from cypress-react-selector.
Related Issues (20)
- Cannot read properties of undefined (reading 'waitToLoadReact') HOT 2
- Would this work with 3rd party libraries? Such as Material UI? HOT 2
- getting webpack-dev-server warning on resqInjector.js attaching the error. HOT 1
- Selectors are failing when upgrading to React 18 HOT 12
- Update plugin to be compatible with Cypress 10 HOT 4
- Could not find instance of React in given element HOT 6
- Functions react() and getReact() don't retry upcoming assertions
- Functions react() and getReact() - infinite retrying for failed upcoming assertions HOT 1
- Is it possible to get a component from a portal?
- No "sourceType" field on TSConfig compiler options HOT 1
- Using getCurrentState
- Cypress 12 Compatibility
- Can't find component by props with value of type array of objects. HOT 1
- Not able to access the sample tests (e2e tests) HOT 1
- incompatibility with Reactjs version 18
- Selector is reporting too many/duplicate items
- How to call the function inside of a component? HOT 1
- Option to suppress cy.log in getProps and getCurrentState
- warning message with resq
- Error when using Vite preprocessor due to require.resolve
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cypress-react-selector.