Skip to content
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

Trying to use the lib with TanStack/Table #199

Open
giraud opened this issue Jun 8, 2023 · 3 comments
Open

Trying to use the lib with TanStack/Table #199

giraud opened this issue Jun 8, 2023 · 3 comments

Comments

@giraud
Copy link

giraud commented Jun 8, 2023

We have been using testcafe and testcafe-react-selectors for a long time now in our end-to-end tests.
It is a great lib, thank you for that.

We recently tried to test a new page that is using a tanstack Table with the cells containing our custom Checkbox component.
Unfortunately some of our tests are failing randomly. It happens in normal mode or in native-automation mode.
It is not always failing in the same location, so we know the selectors are correct. And occasionally(rarely) the test succeed.

our selectors:
image

The UserRoleChecbox is problematic, the findReact is not working as expected.

I don’t know how we get into these situations, and my only repro case is our application.
So I tried to debug the lib with lot of logs.
What I found is that sometimes the child is correct and have the expected hierarchy and sometimes not.

For example, here my child is totally empty (the expanded FiberNode is component.child, it should have other children):
log3

in that case I found that the alternate version can get me the correct child.

after digging, I found that the problem happens when the child component has a flag equals to 8. From what I’ve seen, it should correspond to ContentReset. And if I use the alternate child in that case, my tests are passing.

I changed the code to this (in index.js function getRenderedChildren):
image

I don’t know if it is the correct approach or if I am doing something wrong in my tests.
what do you think ?

versions: testcafe@2.6.2 & testcafe-react-selectors@5.0.3

@giraud
Copy link
Author

giraud commented Jun 8, 2023

maybe the same then #146 ?

@aleks-pro
Copy link

Hello @giraud ,

Thank you for your kind words. We appreciate them.

To find the cause of the issue, we need to reproduce it on our side. Could you please share a simple project sample with test code using which we can reproduce the issue?

@giraud
Copy link
Author

giraud commented Jun 15, 2023

yes, I understand, but that is my problem right now: having a small reproducible app :(.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants