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

Switch component is reported as visible when hidden by the navigation bar #3984

Closed
2 tasks done
arcln opened this issue Mar 15, 2023 · 4 comments
Closed
2 tasks done

Comments

@arcln
Copy link

arcln commented Mar 15, 2023

What happened?

I use the following code to scroll to a switch component and tap it :

await waitFor(element(by.id('my-switch')))
	.toBeVisible()
	.whileElement(by.id('my-scroll-view'))
	.scroll(200, 'down');
await element(by.id('my-switch')).tap();

However on Android the tap action fails :

Test Failed: Couldn't click at: 950.5,1891.0 precision: 16.0, 16.0 . Tapper: com.wix.detox.espresso.action.DetoxSingleTap@58bd328 coordinate provider: VISIBLE_CENTER precision describer: FINGER. Tried 3 times. With Rollback? false
  • By looking at the screen I can see the switch is not visible, but would be if there was no navigation bar.
  • By looking at the coordinates I can see it taps at y = 1891, and the device is 1920px height, so it definitely is inside the navigation bar.

The device I test on is a Pixel API 28 emulator.

What was the expected behaviour?

I expected the switch not to be reported as visible before it is actually tappable.

For now my workaround is to ask detox to scroll further than actually needed.

Was it tested on latest Detox?

  • I have tested this issue on the latest Detox release and it still reproduces.

Did your test throw out a timeout?

Help us reproduce this issue!

Put a switch in a scroll view, make sure it is low enough so scroll is required.
Then use the code snippet above to reach it and notice it stops scrolling too soon.

In what environment did this happen?

Detox version: 20.5.0
React Native version: 0.71.4
Has Fabric (React Native's new rendering system) enabled: (yes/no) no
Node version: 16.13.0
Device model: mac m1 monterey / pixel api 28 emulator
Android version: 9
Test-runner (select one): jest

Detox logs

Detox logs
paste logs here!

Device logs

Device logs
paste your device.log here!

More data, please!

No response

@arcln arcln changed the title Switch component is reported as visible even when hidden by the navigation bar Switch component is reported as visible when hidden by the navigation bar Mar 15, 2023
@asafkorem
Copy link
Contributor

Hi @arcln, it's hard to figure what exactly was the cause for this issue based only on the issue description.
Is it possible that while the scrolling took effect, the navigation bar was hidden (and appeared after the scrolling was ended)?

@arcln
Copy link
Author

arcln commented Mar 18, 2023

No, the navigation bar does not hide or show, it never moves (on API 28 at least).

I will try to craft some minimal reproductible example but I'm not sure when I'll find the time for this.

@stale
Copy link

stale bot commented Apr 25, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest Detox and report back.

Thank you for your contributions!

For more information on bots in this repository, read this discussion.

@stale stale bot added the 🏚 stale label Apr 25, 2023
@stale
Copy link

stale bot commented May 3, 2023

The issue has been closed for inactivity.

@stale stale bot closed this as completed May 3, 2023
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

2 participants