-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
How to select single component from multiple on page #41
Comments
Hi @claytron5000 , thanks for raising the query. You wanna look into the Let me know if that does not work. I will be happy to dig into that. |
That's exactly it. I was getting an error, but I think it was a bad selector. Thanks for the cool tool! |
Hi @claytron5000, when I created the tool, I actually tested against a smaller set of use cases. It is also possible that the error you are getting is a valid error and I missed to handle that very logic. If you get the error, again and again, I request you to re-open the ticket and help me to get it resolved. Thanks a lot again for giving a try with the tool. :) |
also, not, |
Yeah, it looks legit. cypress.json:
Test code:
React code:
The |
Hey @claytron5000 Thanks for re-opening and for the logs. Would you mind also sharing the cypress window error messages? Screenshot will be enough. I want to see the waiting period and the messages it is producing. |
I don't see the waiting period.
|
Hi @claytron5000, can you try upgrading to |
@abhinaba-ghosh I'm getting the same issue on version 2.2.0. Error: Component not found Here is my config:
Strangely, this only happens when I run inside a docker container. When I run the tests locally it finds the component just fine and all tests pass. Here's what I'm trying to do in my test...
|
@zRealMikeJordan, The library works irrespective of the underlying infrastructure. So, if it is working in your local, not in the docker, there is a high chance that the application under test has been changed. Are you building the react app for production and testing it in the docker? Sometimes, it changes the component names. Try building in |
I found the issue. It was actually that the react build resulted in a tree
of “anonymous” components and so you lib couldn’t find the components I
referenced.
I fixed this by doing a dev build in the container but because react
scripts is so slow I had to put sleep 30; at the beginning to wait for
localhost to become available. A bit hacky so if you know a better way
please let me know. I’m not familiar with profile mode.
…On Tue, Oct 27, 2020 at 12:57 AM Abhinaba Ghosh ***@***.***> wrote:
@zRealMikeJordan <https://github.com/zRealMikeJordan>, The library works
irrespective of the underlying infrastructure. So, if it is working in your
local, not in the docker, there is a high chance that the application under
test has been changed. Are you building the react app for production and
testing it in the docker? Sometimes, it changes the component names. Try
building in profile mode and try.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#41 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFRYYUPRGGPXPQHVUITW4GDSMZOOBANCNFSM4RDGHWBQ>
.
|
Hey @zRealMikeJordan , good to know that you figured out the issue. This can help to get some idea about the profiling mode. |
@abhinaba-ghosh Thanks for all of your work on this! Unfortunately, chained commands still aren't working for me. I have two describe("Sidebar", () => {
beforeEach(() => {
cy.waitForReact();
});
it("opens sidebar on click", () => {
cy.react("DashboardFooter").react("MenuButton").click();
});
}); returns
Only one Cypress v5.5.0 {
"pluginsFile": false,
"baseUrl": "http://localhost:8080",
"env": {
"cypress-react-selector": {
"root": "#root"
}
}
} |
@caseyjhol I will have a look into this. |
Hi, just catching up on things. I have created this repository to reproduce this bug. I am digging in. I will update the progress here. |
A dependent ticket has been created in resq module to track. |
This not being able to find React issue seems to be related to some changes in the way React attaches the FiberNodes to the elements. The release RESQ v1.10.0 should fix it. Now, as to the chain operations. This is not supported in RESQ and should be handled at a library level. One of the ways to do this, is to do |
Thanks for the input @baruchvlz . |
hi @baruchvlz , I have a different thought here. I don’t think you need to call |
hi @abhinaba-ghosh, have you made any progress on this? |
@abhinaba-ghosh I'd gladly help, though I'm not sure where to start. could you point me in the right direction? |
@frysztak You can look into this to get the ground baruchvlz/resq#76 |
hello again @abhinaba-ghosh, I finally took a look at your repo. chained queries don't work for React 16 as well. and seeing that this issue was created before React 17's release - it doesn't seem like it has anything to do with it |
This is now fixed with version Example - https://github.com/abhinaba-ghosh/cypress-react-chain-queries |
I have a number of
IconButton
components on a page. They are mostly differentiated by where they are on the page, so different parents. can I drill down from a selected parent to child?The text was updated successfully, but these errors were encountered: