Giter Club home page Giter Club logo

Comments (11)

abhinaba-ghosh avatar abhinaba-ghosh commented on July 2, 2024

This is intersting. Can you check if that component really exists or not.

cy.waitForReact();
cy.get(..).click()
cy.react('component name', {props:{your prop}}).should('exist');
cy.getReact(..).getProps(..).should('eq', true);

from cypress-react-selector.

joetidee avatar joetidee commented on July 2, 2024

This is what I see when I try the above:
Screen Shot 2020-11-21 at 11 43 10

from cypress-react-selector.

abhinaba-ghosh avatar abhinaba-ghosh commented on July 2, 2024

it's react, not getReact for the exist command:

cy.react('component name', {props:{your prop}}).should('exist');

from cypress-react-selector.

mdn021 avatar mdn021 commented on July 2, 2024

hey, i'm also having this issue.

This is what I'm seeing in react dev tools.
image

This is the code I'm using to look for the component.

cy.waitForReact(); cy.react('DisplayLeadDetails').should('exist');

This is the error I'm seeing.
image

I did notice that if I were to look for say the ba component you see in the screenshot, it does pick it up correctly. Wonder if that can help debug this issue.

from cypress-react-selector.

abhinaba-ghosh avatar abhinaba-ghosh commented on July 2, 2024

Hi, can you guys try with the latest version v2.2.2 and check if still happening.

from cypress-react-selector.

mdn021 avatar mdn021 commented on July 2, 2024

Still getting the same issue, unfortunately.

from cypress-react-selector.

sovanyio avatar sovanyio commented on July 2, 2024

I'm seeing this issue in a component test where each test mounts a new component tree.
The first test works and all other tests work, with .only, but if I allow them all to run, getReact and react queries fail.

This is on cypress 7.2.0.

from cypress-react-selector.

abhinaba-ghosh avatar abhinaba-ghosh commented on July 2, 2024

@sovanyio Thanks for bringing the issue under the light. Can you confirm if the window gets reloaded every time you load a component? If so, you need to call waitForReact each time. I am interested in the codebase, can you share any repository where I can re-produce the bug?

from cypress-react-selector.

sovanyio avatar sovanyio commented on July 2, 2024

Just want to drop a note that this hasn't fell off of my radar, life got unexpectedly busy this week. I will try to get something up next week.

from cypress-react-selector.

rmrao12 avatar rmrao12 commented on July 2, 2024

i think it is because of forwardref type react components i think this plugin does not support them cz i also tried fetching them but it's not working. i also tried cy.react as well
Image 5

from cypress-react-selector.

francisu avatar francisu commented on July 2, 2024

I'm seeing this issue in a component test where each test mounts a new component tree.
The first test works and all other tests work, with .only, but if I allow them all to run, getReact and react queries fail.

This is on cypress 7.2.0.

I have opened this issue, specific to component testing: #235

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.