Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with SplashScreen #26

Closed
GoogleCodeExporter opened this issue Mar 24, 2015 · 6 comments
Closed

Issue with SplashScreen #26

GoogleCodeExporter opened this issue Mar 24, 2015 · 6 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Create an Activity that will be the SplashScreen
2. In the onStart method add a 3 secs sleep
3. After the sleep use startActivity and move to another Activity
3. Test the app using assertCurrentActivity

What is the expected output? What do you see instead?
solo.assertCurrentActivity("Correct activity did not appear.", 
SplashActivity.class); should pass but the logs say:

junit.framework.ComparisonFailure: Correct activity did not appear. 
expected:<...Splash...> but was:<...Home...>


What version of the product are you using? On what operating system?
1.8.0
macos


Original issue reported on code.google.com by maca...@gmail.com on 4 Nov 2010 at 4:32

@GoogleCodeExporter
Copy link
Author

Correct activity did not appear. expected:<...Splash...> but was:<...Home...>

I guess that the Activity that is opened after the splash screen is 
<...Home...>?

Original comment by renasr...@gmail.com on 5 Nov 2010 at 12:07

@GoogleCodeExporter
Copy link
Author

Exactly. I know that using a sleep is not good but I would like to know why 
this test fails.

Some questions:

 * When is solo.assertCurrentActivity executed?
 * Leaving the UI thread alone will fix this issue?

Original comment by maca...@gmail.com on 5 Nov 2010 at 12:14

@GoogleCodeExporter
Copy link
Author

It gets executed after the Home activity is active. By the time 
assertCurrentActivity() gets executed the Splash activity is no longer active. 
Usually the problem is the opposite. Please see this thread:

http://groups.google.com/group/robotium-developers/browse_thread/thread/79a70038
c16e35e6/f08a0d9733982a59?lnk=gst&q=getCurrentActivity#f08a0d9733982a59

In both cases there is unfortunately nothing we can do about it. It takes some 
time for Robotium to load and the activityMonitor to start registering a new 
Activity. If a new Activity is not registered then it will think that it is 
still on the Splash activity. In your case the sleep() prevents that and gives 
time to Robotium to register the new Home activity before 
assertCurrentActivity() is executed. 

Thanks for reporting this. As I said earlier this is a known limitation which 
we can not do anything about.  

Original comment by renasr...@gmail.com on 5 Nov 2010 at 12:34

  • Changed state: WontFix

@GoogleCodeExporter
Copy link
Author

renasreda: Thanks for your reply.
What would you recommend? Leave the SplashScreen untested?

Thanks.

Original comment by maca...@gmail.com on 5 Nov 2010 at 12:49

@GoogleCodeExporter
Copy link
Author

Yes, that is what I would do. I would use assertCurrentActivity() on the Home 
activity instead. And then take it from there.

Original comment by renasr...@gmail.com on 5 Nov 2010 at 12:53

@GoogleCodeExporter
Copy link
Author

Cool, thanks for the support.

Original comment by maca...@gmail.com on 5 Nov 2010 at 1:05

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant