Closed Bug 831714 Opened 12 years ago Closed 11 years ago

Replace mozmill.utils.waitFor with assert/expect.waitFor in remaining Mozmill tests

Categories

(Mozilla QA Graveyard :: Mozmill Tests, defect, P3)

defect

Tracking

(firefox18 fixed, firefox19 fixed, firefox20 fixed, firefox21 fixed, firefox-esr17 fixed)

RESOLVED FIXED
Tracking Status
firefox18 --- fixed
firefox19 --- fixed
firefox20 --- fixed
firefox21 --- fixed
firefox-esr17 --- fixed

People

(Reporter: daniela.p98911, Assigned: daniela.p98911)

Details

(Whiteboard: s=130121 u=enhancement c=assertions p=1)

Attachments

(4 files, 6 obsolete files)

This is a follow-up bug based on bug 793092 where we have replaced all instances of controller.waitFor with assert/expect.waitFor. 

There are remaining instances of mozmill.utils.waitFor in the existing Mozmill tests which should also be replaced.

For instance on default branch:
a) /lib
b) /tests/addons/ide@seleniumhq.org/lib/selenium.js

The instances should be replaced with assert/expect.waitFor.
Priority: -- → P3
Whiteboard: s=130121 u=enhancement c=assertions p=1
Assignee: nobody → dpetrovici
Status: NEW → ASSIGNED
Attached patch patch v1.1 (obsolete) — Splinter Review
Forgot to add the bug no. in the commit message for the patch
Attachment #705829 - Attachment is obsolete: true
Attachment #705829 - Flags: review?(hskupin)
Attachment #705829 - Flags: review?(dave.hunt)
Attachment #705829 - Flags: review?(andreea.matei)
Attachment #705830 - Flags: review?(hskupin)
Attachment #705830 - Flags: review?(dave.hunt)
Attachment #705830 - Flags: review?(andreea.matei)
Comment on attachment 705830 [details] [diff] [review]
patch v1.1

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

Here are my notes, but I would like Henrik or Dave's opinion on using assert/expect as well.

::: lib/addons.js
@@ +192,4 @@
>      var spec = aSpec || { };
>      var timeout = (spec.timeout == undefined) ? TIMEOUT : spec.timeout;
>  
> +    assert.waitFor(function() {

Need space here between function and '('

@@ +264,4 @@
>        this._controller.click(button);
>  
>        // Click the button and wait until menu has been opened
> +      assert.waitFor(function() {

Same here.

@@ +279,4 @@
>        // Make sure the menu has been closed
>        this._controller.keypress(menu, "VK_ESCAPE", {});
>  
> +      expect.waitFor(function() {

Same here.

@@ +1524,2 @@
>     return !!addonInfo;
>   });

Please add a message here.

::: lib/places.js
@@ +8,4 @@
>   * has to be used e.g. for alert boxes and other commonDialog instances.
>   */
>  
> + // Include required modules

No need for the whitespace at the beginning.

@@ +110,4 @@
>      BookmarkHTMLUtils.importFromURL(BOOKMARKS_RESOURCE, true);
>  
>      // Wait for it to be finished
> +    expect.waitFor(function () {

I think assert will be more appropriate here, if we fail it's from inside the observer where we change the flag so we do not successfully import the default bookmarks.

@@ +139,4 @@
>  
>      // Remove the pages, then block until we're done or until timeout is reached
>      browserHistory.removeAllPages();
> +    expect.waitFor(function () {

Same here.
Attachment #705830 - Flags: review?(andreea.matei) → review-
Comment on attachment 705830 [details] [diff] [review]
patch v1.1

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

::: lib/addons.js
@@ +283,2 @@
>          return menu.getNode() && menu.getNode().state === "closed";
>        }, "Menu of utils button has been closed.");

This should be an assert IMO. If not we will have a focus problem here.

@@ +957,3 @@
>        return this.selectedSearchFilter.getNode() === filter.getNode();
>      }, "Search filter '" + filter.getNode().value + "' has been set", timeout,
>         undefined, this);

I think this should also be an assert because following operations will depend on the correct filter.

@@ +1492,2 @@
>      return finished;
>    }, "Addon " + aAddonId + " has been enabled");

Same here. It's an explicit call to disable the addon. When the method returns it should be clear it is disabled or not.

::: lib/places.js
@@ +8,4 @@
>   * has to be used e.g. for alert boxes and other commonDialog instances.
>   */
>  
> + // Include required modules

Hm, which white-space?

@@ +110,4 @@
>      BookmarkHTMLUtils.importFromURL(BOOKMARKS_RESOURCE, true);
>  
>      // Wait for it to be finished
> +    expect.waitFor(function () {

Agree for using assert here.

@@ +139,4 @@
>  
>      // Remove the pages, then block until we're done or until timeout is reached
>      browserHistory.removeAllPages();
> +    expect.waitFor(function () {

Yes

::: lib/toolbars.js
@@ +261,4 @@
>      var spec = aSpec || { };
>      var timeout = (spec.timeout == undefined) ? TIMEOUT : spec.timeout;
>  
> +    assert.waitFor(function() {

nit: please add the space after function

::: tests/addons/ide@seleniumhq.org/lib/selenium.js
@@ +75,4 @@
>     * Wait for the Selenium IDE window to be closed
>     */
>    waitForClosed : function SeleniumManager_waitForClosed() {
> +    expect.waitFor(function () {

This has to be an assert.
Attachment #705830 - Flags: review?(hskupin)
Attachment #705830 - Flags: review?(dave.hunt)
Attachment #705830 - Flags: review-
Attached patch patch v1.2Splinter Review
Performed changes based on reviews.
Attachment #705830 - Attachment is obsolete: true
Attachment #707628 - Flags: review?(hskupin)
Attachment #707628 - Flags: review?(dave.hunt)
Attachment #707628 - Flags: review?(andreea.matei)
Comment on attachment 707628 [details] [diff] [review]
patch v1.2

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

Landed as:
http://hg.mozilla.org/qa/mozmill-tests/rev/8d2428a3cc14 (default)

Please check your username as I had to fix this in the patch before pushing. In the original patch the username is 'sername=dpetrovici'.
Attachment #707628 - Flags: review?(hskupin)
Attachment #707628 - Flags: review?(dave.hunt)
Attachment #707628 - Flags: review?(andreea.matei)
Attachment #707628 - Flags: review+
Comment on attachment 708102 [details] [diff] [review]
patch v1.0 for Aurora branch

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

As mentioned when landing the initial patch, please fix your username. It is currently 'sername=dpetrovici'
Attachment #708102 - Flags: review?(hskupin)
Attachment #708102 - Flags: review?(dave.hunt)
Attachment #708102 - Flags: review?(andreea.matei)
Attachment #708102 - Flags: review-
Comment on attachment 708117 [details] [diff] [review]
patch v1.0 for Beta and Release branches

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

Same issue with username.
Attachment #708117 - Flags: review?(hskupin)
Attachment #708117 - Flags: review?(dave.hunt)
Attachment #708117 - Flags: review?(andreea.matei)
Attachment #708117 - Flags: review-
fixed username Aurora patch
Attachment #708102 - Attachment is obsolete: true
Attachment #708127 - Flags: review?(hskupin)
Attachment #708127 - Flags: review?(dave.hunt)
Attachment #708127 - Flags: review?(andreea.matei)
fixed issues with Beta patch that applies on Release branch too
Attachment #708129 - Flags: review?(hskupin)
Attachment #708129 - Flags: review?(dave.hunt)
Attachment #708129 - Flags: review?(andreea.matei)
Comment on attachment 708129 [details] [diff] [review]
patch v1.1 for Beta and Release branches

Marked the wrong patch as obsolete
Attachment #708129 - Attachment is obsolete: false
Attachment #708129 - Flags: review?(hskupin)
Attachment #708129 - Flags: review?(dave.hunt)
Attachment #708129 - Flags: review?(andreea.matei)
Attachment #708117 - Attachment is obsolete: true
Comment on attachment 708132 [details] [diff] [review]
patch v1.0 for ESR17

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

::: tests/endurance/testTabbedBrowsing_OpenNewWindow/test1.js
@@ +44,5 @@
>        var windowId = mozmill.utils.getWindowId(controller.window);
>  
>        controller.window.close();
>  
> +      assert.utils.waitFor(function () {

This should be assert.waitFor()

::: tests/functional/testPrivateBrowsing/testCloseWindow.js
@@ +55,5 @@
>    // One single window will be opened in PB mode which has to be closed now
>    var cmdKey = utils.getEntity(tabBrowser.getDtds(), "closeCmd.key");
>    controller.keypress(null, cmdKey, {accelKey: true});
>  
> +  assert.utils.waitFor(function () {

This should be assert.waitFor, is skipped on Linux, that is why your report passed.
Attachment #708132 - Flags: review?(hskupin)
Attachment #708132 - Flags: review?(dave.hunt)
Attachment #708132 - Flags: review?(andreea.matei)
Attachment #708132 - Flags: review-
Comment on attachment 708127 [details] [diff] [review]
patch v1.1 for Aurora branch

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

Still applying cleanly, but also does with the original one now.
Attachment #708127 - Flags: review?(hskupin)
Attachment #708127 - Flags: review?(dave.hunt)
Attachment #708127 - Flags: review?(andreea.matei)
Attachment #708127 - Flags: review+
Comment on attachment 708129 [details] [diff] [review]
patch v1.1 for Beta and Release branches

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

::: tests/functional/testPrivateBrowsing/testCloseWindow.js
@@ +55,5 @@
>    // One single window will be opened in PB mode which has to be closed now
>    var cmdKey = utils.getEntity(tabBrowser.getDtds(), "closeCmd.key");
>    controller.keypress(null, cmdKey, {accelKey: true});
>  
> +  assert.utils.waitFor(function () {

Same here as for the ESR17 patch. Needs assert.waitFor()
Attachment #708129 - Flags: review?(hskupin)
Attachment #708129 - Flags: review?(dave.hunt)
Attachment #708129 - Flags: review?(andreea.matei)
Attachment #708129 - Flags: review-
Comment on attachment 708999 [details] [diff] [review]
patch v1.1 for ESR17 branch

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

Looks good now.
Attachment #708999 - Flags: review?(hskupin)
Attachment #708999 - Flags: review?(dave.hunt)
Attachment #708999 - Flags: review?(andreea.matei)
Attachment #708999 - Flags: review+
Comment on attachment 709021 [details] [diff] [review]
patch v1.2 for Beta and Release branches

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

Thanks Daniela.
Attachment #709021 - Flags: review?(hskupin)
Attachment #709021 - Flags: review?(dave.hunt)
Attachment #709021 - Flags: review?(andreea.matei)
Attachment #709021 - Flags: review+
(In reply to Dave Hunt (:davehunt) from comment #23)
> Landed as:
> http://hg.mozilla.org/qa/mozmill-tests/rev/5d4a0603a3ea (mozilla-aurora)
> http://hg.mozilla.org/qa/mozmill-tests/rev/42f83b721a71 (mozilla-beta)
> http://hg.mozilla.org/qa/mozmill-tests/rev/09b1af23d450 (mozilla-release)
> http://hg.mozilla.org/qa/mozmill-tests/rev/4b5c5dac3092 (mozilla-esr17)

Why hasn't this been landed on default first? We do not backport patches before we have proven it didn't regress anything on default. Was it by accident?

Thankfully it was staying green given that we had to run tests for 18.0.2 (release) and the next 19.0 beta today.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Oh wait. My fault. It actually went in on Jan 29th. Sorry. I will adjust all the flags now.
Status: REOPENED → RESOLVED
Closed: 11 years ago11 years ago
Resolution: --- → FIXED
Product: Mozilla QA → Mozilla QA Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: