Closed Bug 809434 Opened 12 years ago Closed 12 years ago

Get rid of controller.assertChecked() in favor of expect.* and assert.* methods

Categories

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

defect

Tracking

(firefox17 wontfix, firefox18 fixed, firefox19 fixed, firefox20 fixed, firefox-esr10 fixed, firefox-esr17 fixed)

RESOLVED FIXED
Tracking Status
firefox17 --- wontfix
firefox18 --- fixed
firefox19 --- fixed
firefox20 --- fixed
firefox-esr10 --- fixed
firefox-esr17 --- fixed

People

(Reporter: whimboo, Assigned: mario.garbi)

References

()

Details

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

Attachments

(3 files, 4 obsolete files)

Similar to bug 782918 we should update our tests and replace any instance of controller.assertChecked() with the appropriate assert.* or expect.* call.
Priority: -- → P2
Whiteboard: [mentor=whimboo][lang=js][good first bug] → [mentor=whimboo][lang=js][good first bug] s=121119 u=enhancement c=assertions p=1
Whiteboard: [mentor=whimboo][lang=js][good first bug] s=121119 u=enhancement c=assertions p=1 → s=121119 u=enhancement c=assertions p=1
Whiteboard: s=121119 u=enhancement c=assertions p=1 → s= u=enhancement c=assertions p=1
Whiteboard: s= u=enhancement c=assertions p=1 → s=121119 u=enhancement c=assertions p=1
Assignee: nobody → alex.lakatos
Status: NEW → ASSIGNED
Do we have an update on that bug? Alex, if you can't work on it please ensure it find the appropriate owner.
Assignee: alex.lakatos → mario.garbi
Attached patch patch v1.0 (obsolete) (deleted) — Splinter Review
changed controller.assertChecked with assert.*
Attachment #693801 - Flags: review?(hskupin)
Attachment #693801 - Flags: review?(dave.hunt)
Attachment #693801 - Flags: review?(andreea.matei)
Comment on attachment 693801 [details] [diff] [review] patch v1.0 Review of attachment 693801 [details] [diff] [review]: ----------------------------------------------------------------- ::: tests/functional/testPreferences/testDefaultPhishingEnabled.js @@ +3,5 @@ > * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ > > // Include necessary modules > var prefs = require("../../../lib/prefs"); > +var { assert } = require("../../../lib/assertions"); This needs to be above prefs. @@ +44,5 @@ > > /** > * Map test functions to litmus tests > */ > // testDefaultPhishingEnabled.meta = {litmusids : [8290]}; I would like to have this removed since we're here and no longer use litmus. ::: tests/functional/testPreferences/testDefaultSecurityPrefs.js @@ +3,5 @@ > * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ > > // Include necessary modules > var prefs = require("../../../lib/prefs"); > +var { assert } = require("../../../lib/assertions"); This needs to be above prefs. @@ +44,5 @@ > > /** > * Map test functions to litmus tests > */ > // testDefaultSecurityPreferences.meta = {litmusids : [8060]}; I would like to have this removed since we're here and no longer use litmus.
Attachment #693801 - Flags: review?(hskupin)
Attachment #693801 - Flags: review?(dave.hunt)
Attachment #693801 - Flags: review?(andreea.matei)
Attachment #693801 - Flags: review-
Attached patch patch v1.1 (deleted) — Splinter Review
Modified patch based on review.
Attachment #693801 - Attachment is obsolete: true
Attachment #693811 - Flags: review?(hskupin)
Attachment #693811 - Flags: review?(dave.hunt)
Attachment #693811 - Flags: review?(andreea.matei)
Comment on attachment 693811 [details] [diff] [review] patch v1.1 Review of attachment 693811 [details] [diff] [review]: ----------------------------------------------------------------- Looks good. Landed as: http://hg.mozilla.org/qa/mozmill-tests/rev/7be14decebeb
Attachment #693811 - Flags: review?(hskupin)
Attachment #693811 - Flags: review?(dave.hunt)
Attachment #693811 - Flags: review?(andreea.matei)
Attachment #693811 - Flags: review+
Attachment #693811 - Flags: checkin+
Let's get this backported once we see there are no regressions. Please test and provide backport patches as needed.
Comment on attachment 693901 [details] [diff] [review] patch v1.2 Non-Default Review of attachment 693901 [details] [diff] [review]: ----------------------------------------------------------------- ::: tests/functional/testPreferences/testDefaultPhishingEnabled.js @@ +36,5 @@ > > // Verify Block Attack Sites and Reported Web Forgeries are checked by default > controller.waitForElement(attackElem, gTimeout); > + assert.ok(attackElem.getNode().checked, "Block Attack Sites checkbox is checked"); > + assert.ok(forgeryElem.getNode().checked, "Reported Web Forgeries checkbox is checked"); Why are those two lines an assert while it has to be an expect? Please come up with a follow-up patch for default. Afterward you can come up with a new backport patch. ::: tests/functional/testPreferences/testDefaultSecurityPrefs.js @@ +36,5 @@ > var sslPref = new elementslib.ID(controller.window.document, "useSSL3"); > var tlsPref = new elementslib.ID(controller.window.document, "useTLS1"); > controller.waitForElement(sslPref, gTimeout); > + assert.ok(sslPref.getNode().checked, "SSL3 Preferences checkbox is checked"); > + assert.ok(tlsPref.getNode().checked, "TLS1 Preferences checkbox is checked"); Same here.
Attachment #693901 - Flags: review?(hskupin)
Attachment #693901 - Flags: review?(dave.hunt)
Attachment #693901 - Flags: review?(andreea.matei)
Attachment #693901 - Flags: review-
Attached patch patch v1.3 Default (obsolete) (deleted) — Splinter Review
Changed "assert.ok" into "expect.ok" as requested above.
Attachment #693811 - Attachment is obsolete: true
Attachment #694295 - Flags: review?(hskupin)
Attachment #694295 - Flags: review?(dave.hunt)
Attachment #694295 - Flags: review?(andreea.matei)
Comment on attachment 694295 [details] [diff] [review] patch v1.3 Default Review of attachment 694295 [details] [diff] [review]: ----------------------------------------------------------------- Just few more things and we're good to go. ::: tests/functional/testFormManager/testClearFormHistory.js @@ +2,5 @@ > * License, v. 2.0. If a copy of the MPL was not distributed with this > * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ > > // Include required modules > +var { assert, expect } = require("../../../lib/assertions"); No need for expect here, it is not used. ::: tests/functional/testPreferences/testDefaultPhishingEnabled.js @@ +2,5 @@ > * License, v. 2.0. If a copy of the MPL was not distributed with this > * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ > > // Include necessary modules > +var { assert, expect } = require("../../../lib/assertions"); If you changed to expect only, there is no need to declare assert too, it is not used. ::: tests/functional/testPreferences/testDefaultSecurityPrefs.js @@ +2,5 @@ > * License, v. 2.0. If a copy of the MPL was not distributed with this > * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ > > // Include necessary modules > +var { assert, expect } = require("../../../lib/assertions"); Same here, no need for assert.
Attachment #694295 - Flags: review?(hskupin)
Attachment #694295 - Flags: review?(dave.hunt)
Attachment #694295 - Flags: review?(andreea.matei)
Attachment #694295 - Flags: review-
Attached patch patch v1.4 Default (obsolete) (deleted) — Splinter Review
Removed { assert } where it was not used used any more.
Attachment #694295 - Attachment is obsolete: true
Attachment #694351 - Flags: review?(hskupin)
Attachment #694351 - Flags: review?(dave.hunt)
Attachment #694351 - Flags: review?(andreea.matei)
Attachment #693811 - Attachment is obsolete: false
Comment on attachment 694351 [details] [diff] [review] patch v1.4 Default Review of attachment 694351 [details] [diff] [review]: ----------------------------------------------------------------- This patch does not apply cleanly because you have already checked in the previous patch (with asserts instead of expect). You need to make a follow-up patch with the changes Henrik and I requested (replacing those asserts with expect() and make sure what modules you import). Please always work with clean repository and don't mark the patches that are already checked-in as obsolete. Thanks.
Attachment #694351 - Flags: review?(hskupin)
Attachment #694351 - Flags: review?(dave.hunt)
Attachment #694351 - Flags: review?(andreea.matei)
Attachment #694351 - Flags: review-
Attached patch patch v1.5 FollowUp for Default (deleted) — Splinter Review
Follow up patch that changes Assert into Expect as requested.
Attachment #694351 - Attachment is obsolete: true
Attachment #695964 - Flags: review?(hskupin)
Attachment #695964 - Flags: review?(dave.hunt)
Attachment #695964 - Flags: review?(andreea.matei)
Comment on attachment 695964 [details] [diff] [review] patch v1.5 FollowUp for Default Review of attachment 695964 [details] [diff] [review]: ----------------------------------------------------------------- Looks good now. Thanks. We'll need this changes backported as well.
Attachment #695964 - Flags: review?(hskupin)
Attachment #695964 - Flags: review?(dave.hunt)
Attachment #695964 - Flags: review?(andreea.matei)
Attachment #695964 - Flags: review+
Comment on attachment 695964 [details] [diff] [review] patch v1.5 FollowUp for Default Review of attachment 695964 [details] [diff] [review]: ----------------------------------------------------------------- This patch doesn't contain any commit message. Please make sure in the future there is one set before uploading a patch. http://hg.mozilla.org/qa/mozmill-tests/rev/ff78ef35d434 (default)
Attachment #695964 - Flags: checkin+
Attached patch patch v1.6 Non-Default (deleted) — Splinter Review
Patch ported for all other branches as requested. Reports coming in a second.
Attachment #693901 - Attachment is obsolete: true
Attachment #698704 - Flags: review?(hskupin)
Attachment #698704 - Flags: review?(dave.hunt)
Attachment #698704 - Flags: review?(andreea.matei)
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Attachment #698704 - Flags: review?(hskupin)
Attachment #698704 - Flags: review?(dave.hunt)
Attachment #698704 - Flags: review?(andreea.matei)
Attachment #698704 - Flags: review+
Product: Mozilla QA → Mozilla QA Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: