jayway/robotium — pull request #18 by tomtheguvnor (2012-05-28 04:46:02+00:00)
Title: Helpful method overloads for waitForActivity() and waitForText()

I'd like to contribute a few new methods to the Solo class which I believe will make a few things slightly more concise.

### 1. waitForActivity() accepts activity Class objects.

I prefer to refer to activities in tests by their Class object rather than by string, mainly because I can rename the activity in Eclipse and the reference gets renamed for me as part of the refactoring.

Currently I am doing this:

solo.waitForActivity(MyActivity.class.getSimpleName());

This seems a little inelegant. With the new overload you can just do this:

solo.waitForActivity(MyActivity.class);

I think this is useful.

### 2. waitForText() accepts a resource ID

As all of my UI strings are held in resource files, I typically refer to those resources in tests when checking that they appear on screen. I would assume this is the most common approach (or else there is a lot of string duplication going on). Currently I am doing:

solo.waitForText(getString(R.string.blah));

With the new overload it is more concise and intuitive:

solo.waitForText(R.string.blah);