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

Accessing views outside of my App package #4037

Closed
pradeipp opened this issue May 2, 2023 · 7 comments
Closed

Accessing views outside of my App package #4037

pradeipp opened this issue May 2, 2023 · 7 comments

Comments

@pradeipp
Copy link

pradeipp commented May 2, 2023

Description

I know detox is a gray box testing tool and that it only takes control of the app in test. But is there a workaround of some sort if you need to access any apps outside of the test app?
Use cases:

  1. if I wanna upload a pic to my app, I get the android photo browser(com.android.documentsui package).
  2. if my app opens a webview in chrome to perform google login

I thought of running appium together with detox but figured that it'd be too complex and probably won't work either

Your environment

Detox version: 20.5.0
React Native version: 0.71.3
Node version: 16
Device model: android 31 aosp
OS: android
Test-runner (select one): jest

@noomorph
Copy link
Collaborator

noomorph commented May 2, 2023

As for web views: https://wix.github.io/Detox/docs/api/webviews/#locating-web-view-elements (supported on Android only, iOS support is planned and in works)

As for uploading, I am not entirely sure. @d4vidi can you advise?

@pradeipp
Copy link
Author

pradeipp commented May 2, 2023

are web views outside of the app package supported too? I tried on a web view hosted by the org.chromium.webview_shell package but it didn't work. I also have another webview inside the app package itself which I can access normally though.

@d4vidi
Copy link
Collaborator

d4vidi commented May 2, 2023

are web views outside of the app package supported too? I tried on a web view hosted by the org.chromium.webview_shell package but it didn't work. I also have another webview inside the app package itself which I can access normally though.

No, it will not work in an external activity. You can resort to using the ui Device API (it's in the docs, I'd share a link but I'm afk)

@pradeipp
Copy link
Author

pradeipp commented May 3, 2023

@d4vidi that's great news. I looked at the implementation but didn't see a way to grab elements by locators. Do we have any plans to add that down the road?

Meanwhile, for external apps outside of our test apps I guess we have to perform click and key press actions by coordinates, with no way to use assertions.?

@pradeipp
Copy link
Author

pradeipp commented May 8, 2023

@d4vidi pinging you in case you missed my questions..

@stale
Copy link

stale bot commented Jun 10, 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 Jun 10, 2023
@stale
Copy link

stale bot commented Jun 17, 2023

The issue has been closed for inactivity.

@stale stale bot closed this as completed Jun 17, 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

3 participants