stephenwang1011 / robotium

Automatically exported from code.google.com/p/robotium
0 stars 0 forks source link

In complex scenario, assertCurrentActivity() doesn't work on ICS with #227

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Create an Activity A with a button which launch another Activity B
2.In the test case start Activity A and click on the button, for example:
  startActivityForResult(new Intent(Activity_A.this,Activity_B.class), RESULT_ACTIVITY_DISMISSED);
3. Sleep for 5 seconds (to allow the activity to be launch)
4. Then do assertCurrentActivity(Activity_B.class)

What is the expected output? What do you see instead?
The assertCurrentActivity fail. It says that the current activity is A whereas 
the activity B is launched.

What version of the product are you using? On what operating system?
Robotium 3.1 on a AVD Emulator with Android 4.0.3.

Please provide any additional information below.
I'm using an AVD with 4.0.3 , when I run complex test scenarios, and the 
problem is where I use the solo.assertCurrentActivity("Asserting " + 
activityClass.getSimpleName(), activityClass);   , the current Activity is not 
update, stay in the last Activity . Using the names for the Activities, the 
current Activity, for Robotium is 'Activity A', but the app is running the 
'Activity B'.

I using and AVD with 1024 Mib and SDK 4.0.3 , and the last Robotium version 
3.1. I tested the same test on HTC Nexus One, with 2.3.4 and emulator with 2.1 
, 2.2, and 2.3, and DON'T FAILS

thanks for your help.
Mariano Salvetti

Original issue reported on code.google.com by salvetti...@gmail.com on 22 Feb 2012 at 8:40

GoogleCodeExporter commented 9 years ago
Please try on 4.0.3 revision 2. Unfortunately nothing can be done from 
Robotium. If it is not working then its a bug in the ActivityMonitor class. 
Basically: activityMonitor.getLastActivity() is not working as specified. 
Please raise this issue at the Android issue tracker instead. 

Original comment by renasr...@gmail.com on 25 Feb 2012 at 4:53