Closed Bug 725483 Opened 12 years ago Closed 12 years ago

Robocop: testBookmark is failing

Categories

(Testing :: Mochitest, defect)

ARM
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla13

People

(Reporter: gbrown, Assigned: Margaret)

References

Details

(Whiteboard: not-fennec-11)

Attachments

(1 file, 1 obsolete file)

The patch for bug 720930 just landed and seemed to make testBookmark reliable, but now it's broken again! It seems to hang when there are no bookmarks...perhaps because of the new distinction between Mobile and Desktop bookmarks.

Curiously, this test appears to still pass on tbpl / try.
I'm also working on a patch for bug 725454 that will hide the headers if there are no bookmarks in a group, so we'll have to make sure our tests are robust enough to handle that. Ideally, we should have tests that make sure no headers show up when there are no bookmarks, then check that the correct headers show up when there are bookmarks.
Blocks: 718827
I am seeing things go wrong on the first call to selectFirstItemInList: We are trying to determine if there are any bookmarks available by trying to click on the first item in the bookmarks list. clickInList(1) returns a non-null list of TextView even when there are no bookmarks -- presumably the ExpandableListView header for "Mobile Bookmarks".

Robotium seems to make no allowance for ExpandableListView. We might need to inspect the TextViews or something like that.

Perhaps it would be best to wait for bug 725454 to be resolved before trying to fix this test.
OS: Mac OS X → Android
Whiteboard: not-fennec-11
(In reply to Geoff Brown [:gbrown] from comment #2)

> Perhaps it would be best to wait for bug 725454 to be resolved before trying
> to fix this test.

Actually now we should just wait for bug 722020 to land. I can help out writing tests for that.
I started working on modifying testBookmark to handle the new interface from bug 722020, so I can take this!
Assignee: gbrown → margaret.leibovic
Hardware: x86 → ARM
Attached patch WIP (obsolete) — Splinter Review
This basically has the same functionality as the old test, but it's cleaned up and works with the new UI from bug 722020.

I also want to add test coverage for pressing the back button to go up a folder level, long tapping for the context menu (and testing various context menu items).
Attachment #599387 - Flags: feedback?(gbrown)
Comment on attachment 599387 [details] [diff] [review]
WIP

Review of attachment 599387 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good!

> I also want to add test coverage for pressing the back button to go up a folder
> level, long tapping for the context menu (and testing various context menu
> items).

Great. testWebContentContextMenu.java.in may be helpful.

::: mobile/android/base/tests/testBookmark.java.in
@@ -53,29 +66,34 @@
> > -        //If a bookmark was created by this test, remove it now.
> > +    private void setUpBookmark() {
> > -        if (created) {
> > +        // Bookmark a page for the test
NaN more ...
> > +        mAsserter.is(mSolo.waitForText("Bookmark removed"), true, "bookmark removed successfully");
> > -                if (bookmarkList != null) {
> > +
> > -                    ArrayList<android.widget.ListView> views = mSolo.getCurrentListViews();
NaN more ...

You may be able to leverage the waitForTest code being introduced in bug 725609: https://bugzilla.mozilla.org/attachment.cgi?id=599348
Attachment #599387 - Flags: feedback?(gbrown) → feedback+
I also just noticed that Brian directly added a bookmark to the DB in his test in bug 725609, and I could potentially do the same thing here, although I guess going through the menu is good for testing the bookmark menu item.
Depends on: 722020
Context for comment 6 should have been something like:

+        boolean listIsEmpty = false;
+        while (listIsEmpty == false) {            
+            if (adapter != null && adapter.isEmpty()) {
+                listIsEmpty = true;
+            } else {
+                // wait a little while before trying again
+                try { Thread.sleep(100); } catch(Exception e) {}
Attached patch patchSplinter Review
I decided to address the context menu tests in a separate bug, since we should probably write a file that tests the context menu for items in all 3 different awesomescreen tabs.

I used waitForTest from bug 725609, which was handy. This test depends on that, as well as bug 722020 and friends. Those dependencies are all in my patch queue if you want to try this out: http://hg.mozilla.org/users/margaret.leibovic_gmail.com/patches/
Attachment #599387 - Attachment is obsolete: true
Attachment #599752 - Flags: review?(gbrown)
Depends on: 725609
Comment on attachment 599752 [details] [diff] [review]
patch

Review of attachment 599752 [details] [diff] [review]:
-----------------------------------------------------------------

This looks awesome!
Attachment #599752 - Flags: review?(gbrown) → review+
(In reply to Margaret Leibovic [:margaret] from comment #11)
> https://hg.mozilla.org/integration/mozilla-inbound/rev/e57a42227b40

I think this landed on m-c a while ago, didn't it?
I guess the merge sheriff missed it:

https://hg.mozilla.org/mozilla-central/rev/e57a42227b40
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla13
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: