Closed
Bug 585764
Opened 14 years ago
Closed 14 years ago
Make Mozmill-test testClearFormHistory local
Categories
(Mozilla QA Graveyard :: Mozmill Tests, defect)
Mozilla QA Graveyard
Mozmill Tests
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: u279076, Assigned: aaronmt)
References
Details
(Whiteboard: [litmus-data])
Attachments
(2 files, 5 obsolete files)
8.06 KB,
patch
|
Details | Diff | Splinter Review | |
6.90 KB,
patch
|
u279076
:
review+
|
Details | Diff | Splinter Review |
Module: testFormManager/testClearFormHistory.js
Test-page: test-files/form_manager/form.html
Assignee | ||
Comment 1•14 years ago
|
||
cleanup + converts test to make use of local-data
Assignee: nobody → aaron.train
Status: NEW → ASSIGNED
Attachment #467425 -
Flags: review?(anthony.s.hughes)
Comment on attachment 467425 [details] [diff] [review]
Patch v1 - (default)
I notice a common flow in this test:
type()
sleep()
assert()
Can you make the test work by using assertJS (or waitForEval) with a timeout?
type()
assertJS()
Attachment #467425 -
Flags: review?(anthony.s.hughes) → review-
Assignee | ||
Comment 3•14 years ago
|
||
Henrik, what do you suggest?
AFAIK, each time we type we sleep for the popup auto complete listing to open. This will change to assertDOMProperty
Comment 4•14 years ago
|
||
Well, sleep is necessary as far as I can remember. So we would have to use waitFor or waitForEval.
Assignee | ||
Comment 5•14 years ago
|
||
Replaced existing sleep() calls with waitFor calls that check the DOM property popupOpen; a boolean that signifies the visibility.
I've never used waitFor before so it seems like a good opportunity here.
One other misc question for this test:
Do we want create a remove form history function in the Places API? Presently, the Places API has a function removeAllHistory(), which removes *everything* -- do we desire to eventually break this down?
Attachment #467425 -
Attachment is obsolete: true
Attachment #471849 -
Flags: review?(anthony.s.hughes)
Comment 6•14 years ago
|
||
Comment on attachment 471849 [details] [diff] [review]
Patch v2 - (default)
>+ controller.waitFor(function() { return popDownAutoCompList.getNode().popupOpen == true; }, TIMEOUT, 100,
>+ "Popup Autocomplete should be visible");
Take the opportunity and use multiple lines for the calls like:
>+ controller.waitFor(function() {
>+ return popDownAutoCompList.getNode().popupOpen == true;
>+ }, TIMEOUT, 100, "Locationbar auto-complete popup should be visible");
Also note that the message is optional. If none is given the content of the callback function is used. Depends on the situation which is the best solution.
Assignee | ||
Comment 7•14 years ago
|
||
Fixed indent and removed optional message because the state of the property can be determined through the content of the callback function.
Attachment #471849 -
Attachment is obsolete: true
Attachment #471868 -
Flags: review?(anthony.s.hughes)
Attachment #471849 -
Flags: review?(anthony.s.hughes)
Comment on attachment 471868 [details] [diff] [review]
Patch v2.1 - (default)
>+ var checkBox = new elementslib.XPath(controller.window.document,
>+ "/*[name()='prefwindow']/*[name()='prefpane'][1]" +
>+ "/*[name()='listbox'][1]/*[name()='listitem'][2]");
Better break this out into more lines on the /.
Attachment #471868 -
Flags: review?(anthony.s.hughes) → review-
Assignee | ||
Comment 9•14 years ago
|
||
Attachment #471868 -
Attachment is obsolete: true
Attachment #473508 -
Flags: review?(anthony.s.hughes)
Attachment #473508 -
Flags: review?(hskupin)
Attachment #473508 -
Flags: review?(anthony.s.hughes)
Attachment #473508 -
Flags: review+
Comment 10•14 years ago
|
||
Comment on attachment 473508 [details] [diff] [review]
Patch v2.2 - [nit fix] (default)
>+const LOCAL_TEST_FOLDER = collector.addHttpResource('../test-files/');
>+const LOCAL_TEST_PAGE = LOCAL_TEST_FOLDER + 'form_manager/form.html';
>+const FNAME = "John";
>+const LNAME = "Smith";
Please separate the page declarations from the strings.
>+var setupModule = function()
> {
Brackets cleanups please.
>+ var submitButton = new elementslib.ID(controller.tabs.activeTab, "SubmitButton");
Please move the declaration up to the name elements.
>+ controller.type(firstName, FNAME.substring(0,2));
>+ controller.waitFor(function() {
>+ return popDownAutoCompList.getNode().popupOpen == true;
>+ }, TIMEOUT, 100);
> controller.assertProperty(popDownAutoCompList, "popupOpen", true);
No need for assertProperty here. Also please always use a message for the waitFor function. It will be much clearer in the report as seeing the code which will even be available via the stack.
>+ controller.waitFor(function() {
>+ return popDownAutoCompList.getNode().popupOpen == true;
>+ }, TIMEOUT, 100);
>+ controller.assertProperty(popDownAutoCompList, "popupOpen", true);
Same here.
> var testClearFormHistory = function()
This function is one case why I don't like to have multiple test functions inside a module. It is absolutely tied to the first function in this test. If it fails, testClearFormHistory will fail too because no form data has been saved. We should absolutely prepare that part for this test. Both test functions can use a helper function for that.
>- controller.sleep(500);
>+ controller.waitFor(function() {
>+ return popDownAutoCompList.getNode().popupOpen == false;
>+ }, TIMEOUT, 100);
This will always pass. Please remember to run negative tests. Waiting for popupOpen will return immediately. We will need better code here.
>- controller.sleep(500);
>+ controller.waitFor(function() {
>+ return popDownAutoCompList.getNode().popupOpen == false;
>+ }, TIMEOUT, 100);
> controller.assertProperty(popDownAutoCompList, "popupOpen", false);
Same here.
Attachment #473508 -
Flags: review?(hskupin) → review-
Assignee | ||
Comment 11•14 years ago
|
||
>Please separate the page declarations from the strings.
Done
>Brackets cleanups please.
Done
>Please move the declaration up to the name elements.
Done
>No need for assertProperty here. Also please always use a message for the
>waitFor function. It will be much clearer in the report as seeing the code
>which will even be available via the stack.
Done
>This function is one case why I don't like to have multiple test functions
>inside a module. It is absolutely tied to the first function in this test. If
>it fails, testClearFormHistory will fail too because no form data has been
>saved. We should absolutely prepare that part for this test. Both test
>functions can use a helper function for that.
For now let's just take this offline and file a followup
>This will always pass. Please remember to run negative tests. Waiting for
>popupOpen will return immediately. We will need better code here.
True, reverted to simply checking the popupOpen property after typing and re-inserted the sleep after the type to give it a chance to determine if the popup opens
Attachment #473508 -
Attachment is obsolete: true
Attachment #477921 -
Flags: review?(anthony.s.hughes)
Reporter | ||
Comment 12•14 years ago
|
||
Comment on attachment 477921 [details] [diff] [review]
Patch v3 - (default)
>+ var checkBox = new elementslib.XPath(controller.window.document,
>+ "/*[name()='prefwindow']" +
>+ "/*[name()='prefpane'][1]" +
>+ "/*[name()='listbox'][1]" +
>+ "/*[name()='listitem'][2]");
>+ var clearButton = new elementslib.Lookup(controller.window.document,
>+ '/id("SanitizeDialog")' +
>+ '/anon({"anonid":"dlg-buttons"})' +
>+ '/{"dlgtype":"accept"}');
Parameters should begin on a newline and indented 2 spaces for 'n' in 'new' in both of these. I'll fix prior to checkin.
Over to Henrik for final review.
Attachment #477921 -
Flags: review?(hskupin)
Attachment #477921 -
Flags: review?(anthony.s.hughes)
Attachment #477921 -
Flags: review+
Comment 13•14 years ago
|
||
Comment on attachment 477921 [details] [diff] [review]
Patch v3 - (default)
>+ controller.waitFor(function() {
>+ return popDownAutoCompList.getNode().popupOpen == true;
>+ }, TIMEOUT, 100, "Autocomplete popup is not open");
The message should contain the expected state not the failing state.
>+ controller.waitFor(function() {
>+ return popDownAutoCompList.getNode().popupOpen == true;
>+ }, TIMEOUT, 100, "Autocomplete popup is not open");
Same here.
>-var testClearFormHistory = function()
We should move this function out into its own module. Please file a bug for it.
r=me with both messages updated.
Attachment #477921 -
Flags: review?(hskupin) → review+
Keywords: checkin-needed
Reporter | ||
Comment 14•14 years ago
|
||
I'll take care of this during check-in.
Reporter | ||
Comment 16•14 years ago
|
||
(In reply to comment #15)
> Created attachment 478070 [details] [diff] [review]
> Patch v3.1 (default)
>
> Nits addressed
Landed:
http://hg.mozilla.org/qa/mozmill-tests/rev/1c87042cb6db [default]
http://hg.mozilla.org/qa/mozmill-tests/rev/b1ccbeff37f8 [mozilla1.9.2]
Please provide a patch for mozilla1.9.1
Keywords: checkin-needed
Assignee | ||
Comment 17•14 years ago
|
||
Attachment #478083 -
Flags: review?(anthony.s.hughes)
Reporter | ||
Comment 18•14 years ago
|
||
(In reply to comment #13)
> -var testClearFormHistory = function()
>
> We should move this function out into its own module. Please file a bug for it.
Filed -> bug 599142
Attachment #478083 -
Flags: review?(anthony.s.hughes) → review+
Reporter | ||
Comment 19•14 years ago
|
||
(In reply to comment #17)
> Created attachment 478083 [details] [diff] [review]
> Patch v3 - (1.9.1)
Landed:
http://hg.mozilla.org/qa/mozmill-tests/rev/26ab46dd4f3b [mozilla1.9.1]
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Comment 20•14 years ago
|
||
Move of Mozmill Test related project bugs to newly created components. You can
filter out those emails by using "Mozmill-Tests-to-MozillaQA" as criteria.
Product: Testing → Mozilla QA
Updated•5 years ago
|
Product: Mozilla QA → Mozilla QA Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•