Giter Club home page Giter Club logo

Comments (11)

abhinaba-ghosh avatar abhinaba-ghosh commented on August 23, 2024 1

Thanks @FDiskas for sharing the repo. I will take a look.

from cypress-react-selector.

abhinaba-ghosh avatar abhinaba-ghosh commented on August 23, 2024 1

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.

abhinaba-ghosh avatar abhinaba-ghosh commented on August 23, 2024

hi @FDiskas , thanks for using the library. Have you tried defining the configuration as stated here?

from cypress-react-selector.

FDiskas avatar FDiskas commented on August 23, 2024

Sure. I used env settings

{
  "env": {
    "cypress-react-selector": {
      "root": "#root"
    }
  }
}

from cypress-react-selector.

abhinaba-ghosh avatar abhinaba-ghosh commented on August 23, 2024

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.

FDiskas avatar FDiskas commented on August 23, 2024

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.

suncihai avatar suncihai commented on August 23, 2024

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.

jericirenej avatar jericirenej commented on August 23, 2024

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.

laurence-myers avatar laurence-myers commented on August 23, 2024

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.

abhinaba-ghosh avatar abhinaba-ghosh commented on August 23, 2024

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.

FDiskas avatar FDiskas commented on August 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.