Android & Robotium - Testing that a fragment shows up?

In my android application (Tablet) I want to verify that after selecting a button the fragment appears on the screen. Is there a way to do this?

Answers


You can get a instance of the FragmentManager in your test since you have access to the activity. You can then either find the fragment by id or by tag and test that it is visible using the fragment method "isVisible" and assert that is set to true.

The javadoc for Fragment.isVisible() states Return true if the fragment is currently visible to the user. This means the fragment has been added, has its view attached to the window, and is not hidden.


Need Your Help

Jquery DOM traversal, TOGGLE CSS PROPERTY

jquery dom traversal

Using Jquery , I want to change the css property 'display:none', from CORRESPONDING {or only underlying to that li tag}class1 to 'display:block', whenever mouse is hovered over Topic1.

Fade out when progressBar disappear

android progress-bar fade

I would like to make a progress bar disappear with a fade. I already saw this on other applications like the well-known SuperSU.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.