Closed Bug 892759 Opened 7 years ago Closed 6 years ago

Change - Add tests for findbar

Categories

(Firefox for Metro Graveyard :: Tests, defect, P3)

All
Windows 8
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jwilde, Assigned: mbrubeck)

References

Details

(Whiteboard: feature=change c=Find_in_page_app_bar u=metro_firefox_user p=2)

Attachments

(2 files)

Some general interesting test cases to cover:

- Opening/closing the findbar from mouse/touch
- Opening the findbar from keyboard
- Searching for text, moving up and down in results
- Escape key to close the findbar
Blocks: 831940
No longer depends on: 892224
Assignee: nobody → mbrubeck
Hardware: x86_64 → All
Summary: Work - Add tests for findbar → Change - Add tests for findbar
Whiteboard: feature=change c=Find_in_page_app_bar u=metro_firefox_user p=0
Priority: -- → P3
Duplicate of this bug: 857840
Blocks: metrov1it11
No longer blocks: metrov1defect&change
Status: NEW → ASSIGNED
QA Contact: jbecerra
Whiteboard: feature=change c=Find_in_page_app_bar u=metro_firefox_user p=0 → feature=change c=Find_in_page_app_bar u=metro_firefox_user p=2
Attached patch misc cleanupSplinter Review
Some unrelated code cleanup I found while working on this test.  Removing arguments.callee lets us use strict mode for browser-ui.js.
Attachment #775812 - Flags: review?(rsilveira)
Attached patch basic testsSplinter Review
This is just a test of the very basic UI access; it doesn't test the actual find-in-page functionality yet.

The BrowserUI.ready flag was useful when running this test alone, to prevent it from running before FindHelperUI.init.
Attachment #775815 - Flags: review?(rsilveira)
Comment on attachment 775812 [details] [diff] [review]
misc cleanup

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

Yay for more use strict!
Attachment #775812 - Flags: review?(rsilveira) → review+
Comment on attachment 775815 [details] [diff] [review]
basic tests

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

::: browser/metro/base/tests/mochitest/browser_findbar.js
@@ +40,5 @@
> +    let tab = yield addTab(chromeRoot + "browser_findbar.html");
> +    yield waitForCondition(() => BrowserUI.ready);
> +    is(Elements.findbar.isShowing, false, "Find bar is hidden by default");
> +
> +    ContextUI.displayNavbar();

Better use
yield showNavBar();

@@ +42,5 @@
> +    is(Elements.findbar.isShowing, false, "Find bar is hidden by default");
> +
> +    ContextUI.displayNavbar();
> +    EventUtils.sendMouseEvent({ type: "click" }, "menu-button");
> +    EventUtils.sendMouseEvent({ type: "click" }, "context-findinpage");

You may need to wait for the popup to show, to avoid timing issues.
Attachment #775815 - Flags: review?(rsilveira) → review+
I'll call this bug done for now, though we can certainly use more find-in-page test cases if anyone wants to contribute them.

http://hg.mozilla.org/integration/mozilla-inbound/rev/717ef3f14976
http://hg.mozilla.org/integration/mozilla-inbound/rev/1f36a22f18ad
Flags: in-testsuite+
I missed one of the review comments; applied it in a follow-up patch:
https://hg.mozilla.org/integration/mozilla-inbound/rev/29731607f35e
You need to log in before you can comment on or make changes to this bug.