Tuesday, May 18, 2010

[android-developers] Functional testing multiple activities (ActivityInstrumentationTestCase2)

Hi,

I'm trying to write some functional unit-tests that involve multiple
activities (end-to-end testing).
I have great trouble to write stable tests, especially when
ActivityMonitors are involved.

When my root-activity starts another activity, i try to use
ActivityMonitors to check if the other activity has started. I use the
activityMonitor.waitForActivityWithTimeout(timeout) (where
activityMonitor is a non-blocking activity monitor for
'AnotherActivity.class.getName()'). The problem is that
waitForActivityWithTimeout sometimes works fine and returns the
instance of AnotherActivity. However, often it just waits for
'timeout' milliseconds and returns null and my root-activity is still
considered the 'active' or 'last' activity. But when i check the
screen, the AnotherActivity has been showing!

Should i be using ActivityInstrumentationTestCase2? Or some other test-
case class?
How does one write reliable, non-fragile, functional unit-tests
spanning multiple activities?

Thank you!

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate