Closed Bug 665497 Opened 13 years ago Closed 6 years ago

Mozmill test for checking defaults for pref "Use Custom Settings for History"

Categories

(Mozilla QA Graveyard :: Mozmill Tests, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: AlexLakatos, Unassigned)

References

Details

(Whiteboard: [mozmill-functional][mozmill-prefs])

Attachments

(2 files, 1 obsolete file)

Tracking bug for creating a mozmill test for https://litmus.mozilla.org/show_test.cgi?id=16735
Assignee: nobody → alex.lakatos
Status: NEW → ASSIGNED
A Pivotal Tracker story has been created for this Bug: https://www.pivotaltracker.com/story/show/14759687
Whiteboard: [mozmill-places]
Attached patch patch v0.1 (obsolete) — Splinter Review
I'm currently checking the "checked" status of the options. Should I check the labels on them as well?
I'm only checking labels for the options with a dropdown. Should I check the labels on all options or only the selected one?

Ignore the format of the asserts for now, I'll change them in the new format in the next feedback? . Though, do they look ok?

Any other feedback is appreciated.
Attachment #544445 - Flags: feedback?(anthony.s.hughes)
Comment on attachment 544445 [details] [diff] [review]
patch v0.1

>+    var dtds = ["chrome://browser/locale/preferences/main.dtd",
>+		"chrome://browser/locale/preferences/tabs.dtd",
>+                "chrome://browser/locale/preferences/content.dtd",

Fix intendation

>+  var popupMenu = new elementslib.Selector(controller.window.document, '#historyMode');
>+  var customHistory = new elementslib.Selector(controller.window.document, "menuitem[value='custom']");

Can you make these variable names a bit more specific?

>+  // privateBrowsingAutoStart
>+  var privateBrowsingAutoStart = new elementslib.Selector(controller.window.document, '#privateBrowsingAutoStart');
>+  var pbState = privateBrowsingAutoStart.getNode().checked;

Same with these...

Fundamentally, I think your asserts are fine. I don't think you need to be checking the text of the selector label. This is something Mochitests should cover. We only need to verify the functionality is expected.
Attachment #544445 - Flags: feedback?(anthony.s.hughes) → feedback+
Attached patch patch v0.2Splinter Review
Changed the asserts to expects, and changed their messages.
Changed the ResetCallback for teardownModule because I wasn't leaving the profile completely clean in the last wip

(In reply to comment #3)
> Comment on attachment 544445 [details] [diff] [review] [review]
> patch v0.1
> Can you make these variable names a bit more specific?
Can you please provide some suitable examples?
Attachment #544445 - Attachment is obsolete: true
Attachment #545177 - Flags: feedback?(anthony.s.hughes)
In general, an element variable should be named based on it's element type and how it is unique from other elements of the same type.

>+  var popupMenu = new elementslib.Selector(controller.window.document, '#historyMode');

What specifically does this variable refer to? If it's a popup menu, what popup menu? 

>+  var customHistory = new elementslib.Selector(controller.window.document, "menuitem[value='custom']");

Same with this...I'm not clear about what customHistory refers to in the UI.

>+  // privateBrowsingAutoStart
>+  var privateBrowsingAutoStart = new elementslib.Selector(controller.window.document, '#privateBrowsingAutoStart');

Is this a menu item or something else? I can't tell from this line of code.

>+  var pbState = privateBrowsingAutoStart.getNode().checked;

For this one, simply expand out the acronym for the benefit of those who may not know what pb means: privateBrowsingState
Comment on attachment 545177 [details] [diff] [review]
patch v0.2


>+++ b/tests/functional/testPreferences/testDefaultCustomSettingsForHistory.js
>+/**
>+ * Test the Default setting for History
>+ */
>+function testDefaultSettingForHistory() {

Rename to testCustomHistorySettingsDefault

>+  var popupMenu = new elementslib.Selector(controller.window.document, '#historyMode');
>+  var customHistory = new elementslib.Selector(controller.window.document, "menuitem[value='custom']");

Please rename these variables to be more indicative of what elements they represent.

>+  // privateBrowsingAutoStart
>+  var privateBrowsingAutoStart = new elementslib.Selector(controller.window.document, '#privateBrowsingAutoStart');

Same with this variable...and any other variables in your tests.

>+  var pbState = privateBrowsingAutoStart.getNode().checked;

Any references to pb should be expanded to "privateBrowsing"

>+  // rememberHistory

Please be more specific with comments.

>+  expect.ok(downloadsState, "'Remember download history' is not checked");

Please indicate element type in your message.

>+  expect.equal(untilActual, untilExpected, "'Keep until:'"+ "got '" + untilActual + "', expected '" + untilExpected + "'" );

Please move the message to the next line and wrap as necessary.

>+  expect.equal(locbarActual, locbarExpected, "'When using the location bar, suggest:'"+ "got '" + locbarActual + "', expected '" + locbarExpected + "'" );

Same here.
Attachment #545177 - Flags: feedback?(anthony.s.hughes) → feedback+
Attached patch patch v0.3Splinter Review
Changed the variable names. broke extremely long lines.
Attachment #545948 - Flags: feedback?(anthony.s.hughes)
Comment on attachment 545948 [details] [diff] [review]
patch v0.3

>+  var historyPopupMenu = new elementslib.Selector(controller.window.document, '#historyMode');
>+  var customHistoryOption = new elementslib.Selector(controller.window.document, "menuitem[value='custom']");

We should move the selectors into getter methods in the API. Can you file a bug for this? Please include all elements you've used 'elementslib' for in this code and other tests. Please also include Vlad on this bug so he can add his own instances.

>+  expect.equal(locbarActualLabel, locbarExpectedLabel, "'When using the location bar, suggest:'" +
>+               "got '" + locbarActualLabel + "', expected '" + locbarExpectedLabel + "'" );

Please use the following wrapping format:

expect.equal(locbarActualLabel, locbarExpectedLabel, 
             "'When using the location bar, suggest:' - got '" + locbarActualLabel + 
             "', expected '" + locbarExpectedLabel + "'" );

Please ask Geo for follow up review.
Attachment #545948 - Flags: feedback?(anthony.s.hughes) → feedback-
There is no need anymore to use get/expected in the message. That's done internally. Just say what you expect.
Depends on: 671832
Any progress here?
Whiteboard: [mozmill-places] → [mozmill-functional][mozmill-prefs]
Assignee: alex.lakatos.dev → nobody
Status: ASSIGNED → NEW
Mozmill is dead, WONTFIX the remaining bugs.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
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: