RobotiumTech / robotium

Android UI Testing
http://www.robotium.org
Apache License 2.0
2.86k stars 786 forks source link

Missing support for account picker? #782

Open ciscox83 opened 9 years ago

ciscox83 commented 9 years ago

http://stackoverflow.com/questions/22746664/robotium-chose-an-account-in-accoutpicker-with-solo

renas commented 9 years ago

You should be able to use solo.clickOnText or solo.clickOnView to click it.

On Thu, Sep 24, 2015 at 8:46 AM, Christian Sisti notifications@github.com wrote:

http://stackoverflow.com/questions/22746664/robotium-chose-an-account-in-accoutpicker-with-solo

— Reply to this email directly or view it on GitHub https://github.com/RobotiumTech/robotium/issues/782.

ciscox83 commented 9 years ago

Not sure if that is the solution. We don't have a text neither a view to pass as an input.

Just to clarify I am speaking about this:

Intent pickContactIntent = 
new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);

startActivityForResult(pickContactIntent,REQUEST_PICK_CONTACT);

This will display a dialog from where we can choose an account (or add a new one).

ciscox83 commented 9 years ago

Or better, for handling this

 final Intent accountPickerIntent =
                AccountPicker.newChooseAccountIntent(null, null, new String[]{"com.google"}, false, null, null, null, null);

I would expect something like:

solo.setAccountPicker(accountPickerIntent, ...