How to call the function inside of a component?
vikasm98 opened this issue · comments
I am getting the component when I use
cy.getReact('BasicTray').then((comp) => {
cy.log('comp', comp)
})
and in the logs I can see the following output as shown in the image
but I am not able to get the function exists inside of that component.
I use this code to get the function of that component
cy.getReact('BasicTray').invoke('toggleMic')
I am getting this fllowing error
i am also getting the same error when i want to get the variable inside of that component
is there a way to get the function and call the function inside cypress end to end testing?
This is similar you would ask - how users by visiting a website could invoke some random react component function visible on the page.
Looks like you need to take a look at unit tests instead of e2e.
E2E tests should test users' flow and interactions.