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

Driving out of app areas #359

Closed
rajdeepv opened this issue Dec 20, 2018 · 8 comments
Closed

Driving out of app areas #359

rajdeepv opened this issue Dec 20, 2018 · 8 comments

Comments

@rajdeepv
Copy link
Collaborator

There are cases where we have to drive out of app areas. Example:
AppUnderTest (has an upload photo button which opens Android Gallery)=> Select photos => Back to AppUnderTest
AppUnderTest => Open GooglePlay payment flow => Pay using GooglePlay => Back to AppUnderTest

espresso-driver already has InteractionHelper with UiDevice and therefore there is a possibility of driving out of app areas. It can possibly be a simple mobile command to which we give uiautomator2 script to execute (similar to https://github.com/appium/appium-uiautomator2-server/blob/ce4b766cf702e9d0b8b2304b06a8fd00aaff8fd6/app/src/main/java/io/appium/uiautomator2/utils/UiAutomatorParser.java)

@dpgraham
Copy link
Contributor

dpgraham commented Dec 20, 2018

Yeah this is a limitation of Espresso. Espresso only tests the 'app-under-test', which has pro's and con's. UiAutomator2 can test external apps.

I think what we should be doing is merging our UiAutomator2 driver into Espresso and having the ability to change native contexts.

@rajdeepv
Copy link
Collaborator Author

It definitely makes sense to merge both given they have mutually exclusive powers. Is it a plan in near future?

@dpgraham
Copy link
Contributor

Not sure how soon we'll get to it. Depends on if we can have somebody work on it.

@rajdeepv
Copy link
Collaborator Author

@dpgraham as a stop-gap, do you think its a good idea to add a mobile command which can evaluate a uiautomator2 script to workaround this problem? I can try doing that

@dpgraham
Copy link
Contributor

@rajdeepv Yeah if you wanted to work on that, I'm fine with that.

@KazuCocoa
Copy link
Member

KazuCocoa commented Jan 12, 2019

Lovely. > #359 (comment)
I also got feedback about it by friends of mine, but I have no time to work for it hard so far...

@rajdeepv
Copy link
Collaborator Author

@dpgraham @KazuCocoa, What I meant was not a fully fledged script parser, but just a workaround which helps me in very rare cases when I want to click or get the text/contentDescription etc from out of app areas. I already use the simple workaround from my fork for my personal projects. Not sure if it is good enough for upstream.

@mykola-mokhnach
Copy link
Contributor

mykola-mokhnach commented Jan 13, 2019

@rajdeepv create a PR. We'll be happy to review as always.

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

No branches or pull requests

4 participants