Skip to content

Make Touchable* work with Detox 17#1104

Merged
jgonet merged 1 commit intosoftware-mansion:masterfrom
todorone:todorone/detox-17-fix
Jul 16, 2020
Merged

Make Touchable* work with Detox 17#1104
jgonet merged 1 commit intosoftware-mansion:masterfrom
todorone:todorone/detox-17-fix

Conversation

@todorone
Copy link
Copy Markdown
Contributor

All Touchable* are broken when trying to run e2e tests using recently released Detox 17. It's because testID props are attached to Animated.View component instead of BaseButton. This PR fix it making e2e tests using Detox working again.

@todorone
Copy link
Copy Markdown
Contributor Author

@jakub-gonet Is it possible to merge this PR?

@jgonet
Copy link
Copy Markdown
Member

jgonet commented Jul 16, 2020

Sure, I don't see any blockers.

Next release should be out in the next few weeks.

@jgonet jgonet changed the title Make Touchable* working with Detox 17 Make Touchable* work with Detox 17 Jul 16, 2020
@jgonet jgonet merged commit 733fafa into software-mansion:master Jul 16, 2020
@todorone todorone deleted the todorone/detox-17-fix branch July 16, 2020 10:08
@Guuz
Copy link
Copy Markdown

Guuz commented Jul 21, 2020

@jakub-gonet Any chance we can do this sooner than "a few weeks"? This prevents users from updating to RN 0.63 and Detox 0.17 (which are related).

@jgonet
Copy link
Copy Markdown
Member

jgonet commented Jul 21, 2020

If that's a blocker I can prepare a release tomorrow.

@jgonet
Copy link
Copy Markdown
Member

jgonet commented Jul 22, 2020

1.7.0 has been released
https://github.com/software-mansion/react-native-gesture-handler/releases/tag/1.7.0

@Guuz
Copy link
Copy Markdown

Guuz commented Jul 22, 2020

@todorone With 1.7.0 i'm still getting this issue, did it work for you?

Test Failed: View “<RCTTextView: 0x7fd56c7310a0>” is not hittable at point “{"x":58.5,"y":12.166664123535156}”: Another view “<RNGestureHandlerButton: 0x7fd56e21add0>” is hittable at window point “{"x":187.5,"y":210.16664886474609}”

@todorone
Copy link
Copy Markdown
Contributor Author

todorone commented Jul 22, 2020

@Guuz Hm, it fixed the issue for me, but I done it locally, I'll check new release tomorrow and let You know...

@Guuz
Copy link
Copy Markdown

Guuz commented Jul 22, 2020

@todorone yeah. i'm digging deeper into this. You probably do by.id(), right? we use by.text("foo") which still gives this error... 🤔 because it probably finds the text node, which is not "tappable".

@Guuz
Copy link
Copy Markdown

Guuz commented Jul 22, 2020

Also see the discussion here with Detox: wix/Detox#2156
Using TouchableHighlight from RN (not RNGH) works. So there is a difference with how these things interact which each other. Not sure where the bug is and how to fix it :( But you cant use Detox by.text() with RNGH buttons.

@LeoNatan
Copy link
Copy Markdown

As I mentioned in the issue, there is likely some pointer events set for the text view, or its parent, which is making it decline touch events. Detox 17 and above ensures that elements can be interacted with before actually performing the interaction.

@Guuz
Copy link
Copy Markdown

Guuz commented Jul 24, 2020

I've created a sample project that shows the issue: https://github.com/Guuz/detox-rngh
Video for people reading this that don't want to run the project yourself but want to see the issue: https://streamable.com/chsqms
More context: wix/Detox#2156 (comment)

braincore pushed a commit to braincore/react-native-gesture-handler that referenced this pull request Mar 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants