Yes. Our tests are written on top of pyunit (which runs inside monkeyrunner). We use sameAs and an asset.
For the test cases we are developing, sameAs (with a percentage) is sufficient. This allows things like the time in the status bar and any other possible notifications to get ignored. If you want to do a more complicated comparison (like being able to handle a different background color), you could write your own. MonkeyImage.getRawPixel ( http://developer.android.com/guide/developing/tools/MonkeyImage.html#getRawPixel) is provided exactly for that reason. Bill On Mon, Mar 7, 2011 at 11:55 AM, aniruddha dhamal <[email protected]>wrote: > @bill, > You mentioned that you compare the subsequent snapshots. > I have questions: > Do you use *sameAs* method as an assertion method (like Assert in JUnit) > to verify pass or failure of the testcase? > How do you say that this percentage have changed with the next screenshot > so that testcase is passed? > > Because that wouldn't make my testcases obsolete even if i change the > background color. > > Thanks a lot for your help. > > > > On Tue, Feb 15, 2011 at 4:11 PM, Bill Napier <[email protected]> wrote: > >> Hi Christopher, >> >> Being able to load an image into MonkeyRunner from the filesystem >> makes a lot of sense, I don't see how I had missed that. All the >> test's we've been using MonkeyRunner before only ever wanted to >> compare to subsequent snapshots (to see what has changed). This looks >> pretty straight forward feature to add, but may take me a couple days >> to get to it. >> >> Bill >> >> On Mon, Feb 14, 2011 at 6:14 PM, Christopher M. Judd <[email protected]> >> wrote: >> > According to the monkeyrunner documentation, you can compare >> > screenshot output to known screenshot for regression testing. How do >> > you do this? I see the method sameAs on MonkeyImage but that takes a >> > MonkeyImage presumably one saved on disk for regression testing but >> > there appears to be no way to load one from disk. >> > >> > -- >> > You received this message because you are subscribed to the Google >> > Groups "Android Developers" group. >> > To post to this group, send email to >> [email protected] >> > To unsubscribe from this group, send email to >> > [email protected] >> > For more options, visit this group at >> > http://groups.google.com/group/android-developers?hl=en >> > >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Android Developers" group. >> To post to this group, send email to [email protected] >> To unsubscribe from this group, send email to >> [email protected] >> For more options, visit this group at >> http://groups.google.com/group/android-developers?hl=en >> > > > > -- > Thanks and Regards > > Aniruddha Dhamal > [email protected] > > " No matter which direction you start > Its always against the wind coming back " > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

