Closed Bug 547858 Opened 14 years ago Closed 14 years ago

[mozmill] default max of 6 items

Categories

(Mozilla QA Graveyard :: Mozmill Tests, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: tracy, Assigned: tracy)

Details

Attachments

(1 file, 7 obsolete files)

Attached patch test case (obsolete) — Splinter Review
write mozmill test case for Litmus "Autocomplete dropdown: default max of 6 items"
test case 8451
Attachment #428306 - Flags: review?(hskupin)
Comment on attachment 428306 [details] [diff] [review]
test case

>+    var historyService = Cc["@mozilla.org/browser/nav-history-service;1"].
>+                     getService(Ci.nsINavHistoryService);
>+    historyService.removeAllPages();

Can you please use the historyService instance provided by the PlacesAPI? Would be great if you can also update the other tests accordingly.

>+  // Load some pages to populate history. Default bookmarks will fill the rest.
>+  var websites = ['http://www.google.com/', 'http://www.mozilla.org', 'http://www.mozilla.org/projects/', 'http://www.bugzilla.org/', ];                 

Please use a separate line for each of the URL's.

>+  // Open the test page then about:blank to set up the test test environment
>+  for (var k = 0; k < websites.length; k++) {
>+    locationBar.loadURL(websites[k]);
>+    controller.waitForPageLoad();
>+  }

Please also use "for each" here as what we use in the other tests.

>+  // Get the visible results from the autocomplete list. Verify it is six
>+  var scrollBoxPath = '/id("main-window")/id("mainPopupSet")/id("PopupAutoCompleteRichResult")/anon({"anonid":"richlistbox"})';
>+  var scrollBoxElement = new elementslib.Lookup(controller.window.document, scrollBoxPath);
>+  var numberResultsVisible = scrollBoxElement.getNode().getNumberOfVisibleRows();
>+  controller.assertJS(numberResultsVisible == 6);

Please don't use any Lookup strings in your tests. All those instances will be part of the ToolbarAPI. Replace it with getElement from autoCompleteResults and feed it with "results" as type.

>+testCheckItemHighlight.meta = {litmusids : [8451]};

Please update the function name so it matches the given Litmus test.
Attachment #428306 - Flags: review?(hskupin) → review-
Attached patch test case v2 (obsolete) — Splinter Review
Attachment #428306 - Attachment is obsolete: true
Attachment #428810 - Flags: review?(hskupin)
Attachment #428810 - Flags: review?(hskupin)
Comment on attachment 428810 [details] [diff] [review]
test case v2

As talked on IRC yesterday, please upload the revised version.
Attached patch test case v3 (obsolete) — Splinter Review
Attachment #429190 - Flags: review?(hskupin)
arrrgh, this test case is broken on 1.9.1, getNumberOfVisibleRows() returns '0' instead of '6' as expected.  It works correctly on 1.9.2.  

Question: Is getNumberOfVisibleRows() not supported as a method of richlistbox elements on 1.9.1?
Comment on attachment 429190 [details] [diff] [review]
test case v3

We have sorted those issues out yesterday. Tracy, just upload the two new tests for both branches.
Attachment #429190 - Flags: review?(hskupin)
Attached patch 3.6 test case (obsolete) — Splinter Review
Attachment #428810 - Attachment is obsolete: true
Attachment #429190 - Attachment is obsolete: true
Attachment #433575 - Flags: review?(hskupin)
Attached patch 3.5 test case (obsolete) — Splinter Review
Comment on attachment 433575 [details] [diff] [review]
3.6 test case

>+  // Load some pages to populate history. Default bookmarks will fill the rest.
>+  var websites = [
>+                  'http://www.google.com/',
>+                  'http://www.mozilla.org',
>+                  'http://www.mozilla.org/projects/',
>+                  'http://www.bugzilla.org/',
>+                 ];

The test should also work with no bookmarks listed in the auto-complete. For now you open only 4 different pages which is not enough. Please open at least 7 pages. For this test we should use the local web server. See the following test as an example:

http://hg.mozilla.org/qa/mozmill-tests/file/default/firefox/testTabbedBrowsing/testOpenInBackground.js

>+  // Use type and sleep on each letter to allow the autocomplete to populate with results.
>+  for each (letter in testString) {
>+    locationBar.type(letter);
>+    controller.waitForEval('subject.isOpened == true', 10000, 100, locationBar.autoCompleteResults);
>+  }

Oh, this works now? I can remember that you have had problems with it. Please also update the comment.

>+  var autoCompleteResultsListNode = autoCompleteResultsList.getNode();
>+  controller.assertJS("subject.getNumberOfVisibleRows() == 6", autoCompleteResultsListNode);

Please make it one line. There is no need to declare autoCompleteResultsListNode.

>+var prefDialogSuggestsCallback = function(controller)
[...]
>+  controller.select(suggests, null, null, 0);
>+  controller.sleep(gDelay);
>+  PrefsAPI.preferencesDialog.close(controller, true);

Nit: Can you add an empty line after sleep?
Attachment #433575 - Flags: review?(hskupin) → review-
(In reply to comment #9)

> 
> The test should also work with no bookmarks listed in the auto-complete. For
> now you open only 4 different pages which is not enough. Please open at least 7
> pages. 

It's not important what sort of items are used to populate the auto-complete list; just that there are more than 6 that match the typed string.  


> >+    controller.waitForEval('subject.isOpened == true', 10000, 100, locationBar.autoCompleteResults);
> >+  }
> 
> Oh, this works now? I can remember that you have had problems with it. Please
> also update the comment.

No, that's not working, sorry. I'll revert it back to a sleep
> 
> >+  var autoCompleteResultsListNode = autoCompleteResultsList.getNode();
> >+  controller.assertJS("subject.getNumberOfVisibleRows() == 6", autoCompleteResultsListNode);
> 
> Please make it one line. There is no need to declare
> autoCompleteResultsListNode.

Ack, another remnant of a screwed up repository that I missed. 

> >+  controller.sleep(gDelay);
> >+  PrefsAPI.preferencesDialog.close(controller, true);
> 
> Nit: Can you add an empty line after sleep?

Sure.
(In reply to comment #9)

> 
> The test should also work with no bookmarks listed in the auto-complete. For
> now you open only 4 different pages which is not enough. Please open at least 7
> pages. For this test we should use the local web server. See the following test
> as an example:
> 
> http://hg.mozilla.org/qa/mozmill-tests/file/default/firefox/testTabbedBrowsing/testOpenInBackground.js
> 

I realized that the default bookmarks may get deleted by some other test case. Thus causing this test to fail, as implemented.  Henrik, that sample of using a local web server doesn't shed much light for me.  Is it documented somewhere?
I don't think that there is a documentation available yet on MDC. Poke Clint. For now store at least 7 different HTML files under a subfolder called 'files'. Then you can load those by using the way given in the example above.
Attached patch 3.6 test case v2 (obsolete) — Splinter Review
Attachment #433575 - Attachment is obsolete: true
Attachment #434592 - Flags: review?(hskupin)
Attached patch 3.5 test case v2 (obsolete) — Splinter Review
Attachment #434593 - Flags: review?(hskupin)
Attachment #433576 - Attachment is obsolete: true
Attachment #434593 - Attachment description: 3.5 ytest case v2 → 3.5 test case v2
Comment on attachment 434592 [details] [diff] [review]
3.6 test case v2

Sorry Trace, but with the refactoring of the preferencesDialog class this test needs a little adjustment. When you pull the most recent version of the tests you will see how it works now.

>+  PrefsAPI.preferencesDialog.open(prefDialogSuggestsCallback);

Can you also please move it into the test? UI actions shouldn't be handled in setupModule.

>+var prefDialogSuggestsCallback = function(controller)

This function also has to be updated regarding the refactoring.

>+testVisibleItemsMax.meta = {litmusids : [8451]};

You can leave that out now. We will not use it anymore to reference back Litmus tests. I will write a post tomorrow.
Attachment #434592 - Flags: review?(hskupin)
Comment on attachment 434593 [details] [diff] [review]
3.5 test case v2

Same for this patch.
Attachment #434593 - Flags: review?(hskupin)
Attachment #434592 - Attachment is obsolete: true
Attachment #434593 - Attachment is obsolete: true
Attachment #435965 - Flags: review?(hskupin)
Attachment #435965 - Flags: review?(hskupin) → review+
Comment on attachment 435965 [details]
patch_testVisibleItemMax [checked in]

That one wasn't a patch. But I have created one and landed it on default. When running the test with Firefox 3.5 it will fail on all platforms. So we need another version for 1.9.1.

http://hg.mozilla.org/qa/mozmill-tests/rev/cca2b98b253c
Attachment #435965 - Attachment description: patch_testVisibleItemMax → patch_testVisibleItemMax [checked in]
Attachment #435965 - Attachment is patch: false
Status: NEW → ASSIGNED
Aaron, could you please have a look at the 3.5 failure? Looks like we need a little different version here.
Assignee: twalker → nobody
Component: Location Bar → Mozmill Tests
Product: Firefox → Testing
QA Contact: location.bar → mozmilltests
Version: 3.6 Branch → unspecified
(In reply to comment #19)
> Aaron, could you please have a look at the 3.5 failure? Looks like we need a
> little different version here.

I think we should file a new bug on it.

Tracy, what happened with the Litmus test for 4.0? Got it removed completely? I can't find it. But I have updated the 3.5 and 3.6 tests on Litmus.
Assignee: nobody → twalker
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Whiteboard: [nneds-litmus-update]
Ah got it. It was 10439.
Whiteboard: [nneds-litmus-update]
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
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: