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

Make interaction with native views more reliable #409

Closed
2 tasks
bartekpacia opened this issue Oct 4, 2022 · 1 comment · Fixed by #437
Closed
2 tasks

Make interaction with native views more reliable #409

bartekpacia opened this issue Oct 4, 2022 · 1 comment · Fixed by #437
Labels
package: patrol Related to the patrol package (native automation, test bundling)

Comments

@bartekpacia
Copy link
Contributor

bartekpacia commented Oct 4, 2022

TL;DR We should introduce a (configurable globally and on a per-case basis) timeout when finding native actions. We should also be loud when the native view is not found (currently we fail silently, which is very bad).

For example, see #409 as a result of this problem.

Synopsis

Currently, when the user does:

await $.native.tap(Selector(text: 'Sign in));

the native side checks if a widget with text 'Sign in' exists, and if it doesn't, we crash. This is not a good DX.

The scope is not only to improve tap() and enterText(), but also permission-handling related methods, which are also impacted by this problem.

Goals:

  • add Duration visibleTimeout to NativeAutomator() constructor. This will be the global timeout that defaults to 10 sec. Send timeouts to native automator during constructor call.
  • wait for visibleTimeout instead of crashing immediately when interacting with native views (iOS+Android)

Non-goals (though could be done in the future, when there's a need)

  • make tap() and doubleTap() accept timeout (defaulting to global timeout) on iOS and Android
  • make enterText() accept timeout (defaulting to global timeout) on iOS and Android
  • make permission-handling methods accept timeout (global timeout) on iOS and Android

To do in separate issue:

  • consider adding timeouts to other functions (e.g open/list/tap notifications, getNativeViews)

See also:

cc: @mateuszwojtczak

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar problem, please file a new issue. Make sure to follow the template and provide all the information necessary to reproduce the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: patrol Related to the patrol package (native automation, test bundling)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant