Closed Bug 671315 Opened 13 years ago Closed 13 years ago

Mozmill test for installing multiple extensions

Categories

(Mozilla QA Graveyard :: Mozmill Tests, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: AlexLakatos, Assigned: AlexLakatos)

References

Details

(Whiteboard: [mozmill-restart][mozmill-aom])

Attachments

(1 file, 3 obsolete files)

Tracking of mozmill test creation for installing multiple extensions

Litmus test: https://litmus.mozilla.org/show_test.cgi?id=16977
Assignee: nobody → alex.lakatos
Status: NEW → ASSIGNED
Whiteboard: [mozmill-aom]
A Pivotal Tracker story has been created for this Bug: https://www.pivotaltracker.com/story/show/15725657
Attached patch patch v0.1 (obsolete) (deleted) — Splinter Review
I'm getting an error:
Bug 671315 - Mozmill test for installing multiple extensions
I'm getting an error: 
ERROR | Test Failure: {"exception": {"stack": "AddonsManager_isAddonInstalled([object Proxy])@resource://mozmill/stdlib/securable-module.js -> file:///home/alexlakatos/Desktop/addonsmanager/mozmill-tests/lib/addons.js:344\n@:0\n", "message": "addon.getNode is not a function", "fileName": "resource://mozmill/stdlib/securable-module.js -> file:///home/alexlakatos/Desktop/addonsmanager/mozmill-tests/lib/addons.js", "name": "TypeError", "lineNumber": 344}}
TEST-UNEXPECTED-FAIL | /home/alexlakatos/Desktop/addonsmanager/mozmill-tests/tests/functional/restartTests/testInstallMultipleExtensions/test2.js | testCheckMultipleExtensionsAreInstalled
Attachment #545684 - Flags: feedback?(anthony.s.hughes)
I get a different error:
"AddonsManager_categories: Categories could not be found.", addons.js:643

I ran your test with Firefox 5.0 on mozilla-release branch.
Attachment #545684 - Flags: feedback?(anthony.s.hughes) → feedback+
On mozilla-release, the Extensions pane has a different ID. You will have to change 
>+  am.setCategory({category: am.getCategoryById({id: "extension"})});
to
>+  am.setCategory({category: am.getCategoryById({id: "extensions"})});

or simply run the current patch on the mozilla-beta branch with Firefox 6 Beta
Sorry, I can't help you more to debug this issue until I am back from vacation on Thursday. Henrik or Geo, can you help Alex debug this issue?
I do not see an issue here. Problem is simply that we should hide the real category id in the API to prevent situations and backport confusion like that. See bug 671514.
Depends on: 671514
Attached patch patch v1.0 (obsolete) (deleted) — Splinter Review
Found and fixed the error mentioned in comment #2
Attachment #545684 - Attachment is obsolete: true
Attachment #546525 - Flags: review?(gmealer)
Comment on attachment 546525 [details] [diff] [review]
patch v1.0

+    controller.assert(function () {
+      return addonIsInstalled;
+    }, "Add-on has been installed - got '" + addonIsInstalled + 
+        "', expected 'true'");
+  }

Please use new-style asserts as documented in https://developer.mozilla.org/en/Mozmill_Tests#Logging_Test_Results -- note that the got/expected stuff is handled for you, so you won't need that in the message.

There's a lot of stuff being added to persisted that I don't see deleted at the end of the string of tests. I'm unsure of the requirement here, but saw other tests doing that. 

Henrik, can you comment?

Aside from that, things look pretty good. The assert is the main blocker, plus whatever Henrik says about cleaning up persisted.
Attachment #546525 - Flags: review?(gmealer) → review-
Yes, the persisted object has to be cleaned-up in teardown.
Comment on attachment 546525 [details] [diff] [review]
patch v1.0

>+++ b/tests/functional/restartTests/testInstallMultipleExtensions/test1.js

Similar to my other review. Please use the Litmus subgroup as prefix for the folder name.

>+  // Store the AMO preview site
>+  persisted.amoPreviewSite = addons.AMO_PREVIEW_SITE;

No need to store the constant in persisted. You always have access to it via the addons module.

>+function testInstallMultipleExtensions() {
>+  for each(addon in persisted.addons) {
>+    // Store a reference to the current add-on in 'persisted.currentAddon'
>+    persisted.currentAddon = addon;

Why? You will directly overwrite it in the next iteration. Also you should use forEach.

>+    var addToFirefox = new elementslib.Selector(controller.window.document, ".install-button a");

This is content and not chrome. So the document has to be controller.tabs.activeTab.

>+    md.start(handleInstallAddonDialog);

This is now part of the addons module. No need to declare the method in the test anymore.

>+    controller.click(addToFirefox);
>+    md.waitForDialog(TIMEOUT_DOWNLOAD);
>+    controller.keypress(null , 'VK_ESCAPE', {});

Why do you have to press escape? 

>+const TIMEOUT_DOWNLOAD = 25000;

We do not download anything in this test. So this constant is not necessary.

>+const ADDONS = [
>+  {name: "Add-on Compatibility Reporter",
>+   id: "compatibility@addons.mozilla.org",
>+   url: addons.AMO_PREVIEW_SITE + "/firefox/addon/15003/"},
>+  {name: "Mozilla QA Companion",
>+   id: "{667e9f3d-0096-4d2b-b171-9a96afbabe20}",
>+   url: addons.AMO_PREVIEW_SITE + "/firefox/addon/5428/"}
>+];

This is part of the persisted object. No need to redeclare the array in the second test.

>+  // Store the AMO preview site
>+  persisted.amoPreviewSite = addons.AMO_PREVIEW_SITE;
>+
>+  // Whitelist add the AMO preview site
>+  addons.addToWhiteList(persisted.amoPreviewSite);
>+
>+  // Store the addons object in 'persisted.addons'
>+  persisted.addons = ADDONS;

Same for all those code.

>+  for each(addon in persisted.addons) {

As mentioned above use forEach

>+    persisted.currentAddon = addon;

Not necessary. It's not used.

>+    controller.assert(function () {
>+      return addonIsInstalled;
>+    }, "Add-on has been installed - got '" + addonIsInstalled + 
>+        "', expected 'true'");

As Geo has mentioned, please use the new assertions module.
Attached patch patch v2.0 (obsolete) (deleted) — Splinter Review
Changed the assert and addressed all of Henrik's comments

> Why do you have to press escape? 
There is a doorhanger notification that appears and I'm pressing escape to dismiss it
Attachment #546525 - Attachment is obsolete: true
Attachment #546779 - Flags: review?(gmealer)
Comment on attachment 546779 [details] [diff] [review]
patch v2.0

Code looks great, thanks for all the changes. I guess the only outstanding question is how are we dealing with the extension/extensions thing?

As I understand it, this patch is for default, aurora, beta; and I still need a slightly modified one for release. Is that correct?

r+'ing, holding off on checkin until the proper branches to land on are verified.
Attachment #546779 - Flags: review?(gmealer) → review+
Alex, can you confirm what branches this patch tests PASS? This is a new test so I'm guessing we want to to work on default, aurora, beta, and release.
This patch runs fine on release and beta, but fails on default and aurora because the addons are not compatible.
Do we want to change the test to use some addons from http://mozqa.com/data/firefox/addons/extensions/ (we may have to build them) or just skip this test on aurora and default?
Or maybe search for other two compatible addons on addons.allizom.org ?
We want to use add-ons in this order:

1. From the local system (served via HTTPd)
2. From mozqa.com
3. From AMO

Whereby the add-on from option 1 should be the same as for option 2.
Depends on: 685515
Please prioritize fixing the dependency. We will have to retest/review the patch on this bug once the dependency is resolved.
Keywords: checkin-needed
Attachment #546779 - Flags: review+
Attached patch patch v3.0 [checked-in] (deleted) — Splinter Review
changed the test to use the local addons
Attachment #546779 - Attachment is obsolete: true
Attachment #563419 - Flags: review?(anthony.s.hughes)
(In reply to Alex Lakatos from comment #17)
> Created attachment 563419 [details] [diff] [review] [diff] [details] [review]

Does this patch depend on further check-ins from bug 685515?
(In reply to Anthony Hughes, Mozilla QA (irc: ashughes) from comment #18)
> Does this patch depend on further check-ins from bug 685515?
No, everything that was needed for this test already landed.
Attachment #563419 - Flags: review?(anthony.s.hughes) → review+
Please check tomorrow's testrun set bug to verified if passing, reopen if failing.
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Whiteboard: [mozmill-aom] → [mozmill-functional][mozmill-aom]
Status: RESOLVED → VERIFIED
Whiteboard: [mozmill-functional][mozmill-aom] → [mozmill-restart][mozmill-aom]
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: