Closed Bug 656255 Opened 13 years ago Closed 13 years ago

Have only one test function in testPaneRetention.js

Categories

(Mozilla QA Graveyard :: Mozmill Tests, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: AlexLakatos, Assigned: AlexLakatos)

References

Details

Attachments

(1 file, 3 obsolete files)

File: tests/functional/testPreferences/testPaneRetention.js

This test module consists of two tests:
 * testOpenCloseOptionsDialog()
 * testOptionsDialogRetention()

These should be split into two separate test modules.  I recommend moving testOpenCloseOptionsDialog() to its own module testOpenClosePane.js.
Blocks: 627975
* testOpenCloseOptionsDialog() - https://litmus.mozilla.org/show_test.cgi?id=15481

* testOptionsDialogRetention()-https://litmus.mozilla.org/show_test.cgi?id=15480
Assignee: nobody → alex.lakatos
Status: NEW → ASSIGNED
A Pivotal Tracker story has been created for this Bug: https://www.pivotaltracker.com/story/show/13265015
Attached patch patch v1.0 (obsolete) — Splinter Review
Attachment #531618 - Flags: review?(hskupin)
Attachment #531618 - Flags: review?(anthony.s.hughes)
Alex Lakatos changed story state to started in Pivotal Tracker
Comment on attachment 531618 [details] [diff] [review]
patch v1.0

Review of attachment 531618 [details] [diff] [review]:
-----------------------------------------------------------------
Attachment #531618 - Flags: review?(hskupin)
I'm not sure about the usefulness of testOpenCloseOptionsDialog(). This is being tested inherently through testOptionsDialogRetention(). For that matter, we might want to disable the Litmus test as well.

Henrik, please advise.
I agree. This test seems to be well covered by other existing tests in the BFT section as the pane retention one.
Attached patch patch v2.0 (obsolete) — Splinter Review
Attachment #531618 - Attachment is obsolete: true
Attachment #531618 - Flags: review?(anthony.s.hughes)
Attachment #531869 - Flags: review?(anthony.s.hughes)
Summary: Split testPaneRetention.js into two modules → Have only one test function in testPaneRetention.js
Comment on attachment 531869 [details] [diff] [review]
patch v2.0

>  * The Initial Developer of the Original Code is Mozilla Foundation.
>  * Portions created by the Initial Developer are Copyright (C) 2009

Date should be updated to 2011.

> const gDelay = 0;
> const gTimeout = 5000;

Can you rename gDelay to DELAY and gTimeout to TIMEOUT? Also, if gDelay is not used anywhere in the test, simply remove it.

> var setupModule = function(module) {
>   module.controller = mozmill.getBrowserController();
> }

Can you change this from "module.controller = " to "controller ="?

>-var testOpenCloseOptionsDialog = function()
>-{
>-  // Reset pane to the main pane before starting the test
>-  prefs.openPreferencesDialog(controller, prefPaneResetCallback);
>-}

We should probably include this in a teardownModule() so the test exits in a clean state. You'll need to incorporate some aspect of prefPaneResetCallback. Actually you might be able to do this using the Prefs shared module. Henrik, please advise.

>  * Panes of preferences dialog should retain state when opened next time
>  */

I don't really like the wording of this. Can you change it to "Test the Preferences dialog retains state"?

> var testOptionsDialogRetention = function()
> {

Since we refer to the dialog as "Preferences" everywhere else, we should probably rename this function and the JS file.

>   // Choose the Privacy pane
>   prefs.openPreferencesDialog(controller, prefPaneSetCallback);
> 
>   // And check if the Privacy pane is still selected
>   prefs.openPreferencesDialog(controller, prefPaneCheckCallback);

Same with resetting the pane to Main, you can probably do this without the callback.  Henrik, please advise.
http://hg.mozilla.org/qa/mozmill-tests/file/9f5ffc869d1f/lib/prefs.js#l110
 
> /**
>  * Map test functions to litmus tests
>  */
>+// testOptionsDialogRetention.meta = {litmusids : [15480]};

I think this can be completely removed. Henrik, please advise.
Attachment #531869 - Flags: review?(anthony.s.hughes) → review-
(In reply to comment #10)
> > const gDelay = 0;
> > const gTimeout = 5000;
> 
> Can you rename gDelay to DELAY and gTimeout to TIMEOUT? Also, if gDelay is
> not used anywhere in the test, simply remove it.
> 
> > var setupModule = function(module) {
> >   module.controller = mozmill.getBrowserController();
> > }
> 
> Can you change this from "module.controller = " to "controller ="?

We do not want to completely rewrite those tests. It's really just a separation. Any further modifications we should do once we start with the transition to the new API.

> >-var testOpenCloseOptionsDialog = function()
> >-{
> >-  // Reset pane to the main pane before starting the test
> >-  prefs.openPreferencesDialog(controller, prefPaneResetCallback);
> >-}
> 
> We should probably include this in a teardownModule() so the test exits in a
> clean state. You'll need to incorporate some aspect of
> prefPaneResetCallback. Actually you might be able to do this using the Prefs
> shared module. Henrik, please advise.

Not sure, why an advise is requested here. 

> >   // Choose the Privacy pane
> >   prefs.openPreferencesDialog(controller, prefPaneSetCallback);
> > 
> >   // And check if the Privacy pane is still selected
> >   prefs.openPreferencesDialog(controller, prefPaneCheckCallback);
> 
> Same with resetting the pane to Main, you can probably do this without the
> callback.  Henrik, please advise.

Not sure to what you are referring to here. Any callback is necessary when opening the preferences dialog.

> I think this can be completely removed. Henrik, please advise.

This is clear and we have agreed on it already a while back.
Attached patch patch v4.0 (obsolete) — Splinter Review
Attachment #531869 - Attachment is obsolete: true
Attachment #532910 - Flags: review?(anthony.s.hughes)
Comment on attachment 532910 [details] [diff] [review]
patch v4.0

>+function prefPaneResetCallback(controller)
>+{
>+  let prefDialog = new prefs.preferencesDialog(controller);

Nit: Use "var" not "let".
Attachment #532910 - Flags: review?(anthony.s.hughes) → review-
Attached patch patch v5.0Splinter Review
Attachment #532910 - Attachment is obsolete: true
Attachment #533219 - Flags: review?(anthony.s.hughes)
Comment on attachment 533219 [details] [diff] [review]
patch v5.0

Looks fine to me, thanks. Over to Henrik for final review.
Attachment #533219 - Flags: review?(hskupin)
Attachment #533219 - Flags: review?(anthony.s.hughes)
Attachment #533219 - Flags: review+
Attachment #533219 - Flags: review?(hskupin) → review+
Landed as:
http://hg.mozilla.org/qa/mozmill-tests/rev/3217cb80f392 (default)
http://hg.mozilla.org/qa/mozmill-tests/rev/f697be187e0e (aurora)
http://hg.mozilla.org/qa/mozmill-tests/rev/0d5c8722110a (beta)

Please update the Litmus with the new test path. Also, for the next patches please use hg export so your username and the commit message will appear in the patch. Thanks. Leaving open until the Litmus test has been updated.
Updated https://litmus.mozilla.org/show_test.cgi?id=15480 .
Marking this RESOLVED FIXED
Status: ASSIGNED → RESOLVED
Closed: 13 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: