[mozmill] Test Addon Installation



Mozilla QA
Mozmill Tests
9 years ago
8 years ago


(Reporter: aakashd, Assigned: aakashd)


Firefox Tracking Flags

(Not tracked)


(Whiteboard: [MozMill1.3Testday])


(3 attachments, 6 obsolete attachments)



9 years ago
The test case will open the addons manager, search for Adblock Plus in the Get Addons Pane, click on the install button for adblock plus and verify it has installed.

 * Litmus test #8828: Get Addon: Installing
 * Litmus test #6799: Get Addon: Installing

Comment 1

9 years ago
Created attachment 409143 [details]

I have no idea how to grab the addonInstallButton , but that's my best try. If you have any better ideas, please give it a shot.
Assignee: nobody → adesai
Attachment #409143 - Flags: review?(hskupin)


9 years ago
Whiteboard: [MozMill1.3Testday]
Attachment #409143 - Attachment is patch: false
Attachment #409143 - Flags: review?(hskupin) → review-
Comment on attachment 409143 [details]

That's not a patch. Please always attach a patch which will make my life easier. Thanks.

>  // Open the addons manager and verify the extensions pane is selected
>  controller.click(new elementslib.Elem(controller.menus["tools-menu"].menu_openAddons));
>  controller.sleep(500);
>  var window = mozmill.wm.getMostRecentWindow('Extension:Manager');
>  var addonsController = new mozmill.controller.MozMillController(window);

Please always use getAddonsController. I can see those lines in any of your tests.

>  var installButton = addonsController.window.document.getAnonymousElementByAttribute(searchSelection, "class", "addonInstallButton");

You should use a lookup string and brachiate through the DOM tree until you reach the wanted element. Use the DOMi to get as much as possible. Remember to use getNode().localName to check which element you have fetched.

Comment 3

9 years ago
Created attachment 414354 [details] [diff] [review]
Attachment #409143 - Attachment is obsolete: true
I haven't run the test but while having a quick spot check we should use a better name for the folder. We only need two test files. There is no uninstallation necessary. A folder name could be testExtensionInstallationGetAddonsPane.


9 years ago
Depends on: 534070

Comment 5

9 years ago
Created attachment 417000 [details] [diff] [review]

I receive u'element.ownerDocument is null' when clicking the install button
Attachment #414354 - Attachment is obsolete: true
Attachment #417000 - Flags: review?(hskupin)
Attachment #417000 - Flags: review?(hskupin)
Created attachment 417841 [details] [diff] [review]
Patch (corrected)

Take this. The solution was that elementslib.Elem only takes one argument which is the element itself. No document is needed. I put some more updates into the patch. See if you like it. It makes us safer when choosing the correct add-on.

Comment 7

9 years ago
Created attachment 418741 [details] [diff] [review]
patch with addonsAPI

testscript with addonsAPI changes
Attachment #417841 - Attachment is obsolete: true
Attachment #418741 - Flags: review?(hskupin)

Comment 8

9 years ago
Created attachment 418742 [details]
log with leak in the middle of restart


9 years ago
Depends on: 536286
No longer depends on: 536286
Attachment #417000 - Attachment is obsolete: true
Comment on attachment 418741 [details] [diff] [review]
patch with addonsAPI

>+  // Make sure the Get Add-ons pane is visible
>+  //addonsManager.setPane("search");
>+  // Search for the addon mentioned in extensionName
>+  addonsManager.search(persisted.extensionName);

You can call search only. No need to set the pane first. That will be done automatically.

>+  // Select the extension we have searched for
>+  var extension = new elementslib.Lookup(addonsController.window.document, '/id("extensionsManager")/id("addonsMsg")/id("extensionsBox")/[1]/id("extensionsView")/anon({"name":"' + persisted.extensionName + '"})');

Use the getListItem function here too. It works in all of the panes of the addons manager.

>+var handleTriggerDialog = function(controller) 
>+  // There should be listed only one extension
>+  if (itemElem.childNodes.length != 1) {
>+    throw "Expected one extension for installation";
>+  }

If you are using throw then please do it via "throw new Error(msg)". Otherwise those failures will not be reported. Please fix all instances.

>+  // The installed extension should be displayed with a different background in the list.
>+  // We can find it by the attribute "newAddon"
>+  // XXX: Use a hard-coded name to access the entry directly until we can pass the info
>+  // between restart test files (bug 500987)

Remove the xxx comment. That works quiet a while now.

With the above changes r+.
Attachment #418741 - Flags: review?(hskupin) → review+

Comment 10

9 years ago
Created attachment 418856 [details] [diff] [review]
patch with changes made after previous comment
Attachment #418741 - Attachment is obsolete: true
Attachment #418856 - Flags: review?(hskupin)
Attachment #418856 - Flags: review?(hskupin) → review-

Comment 11

9 years ago
Created attachment 421328 [details] [diff] [review]
update without installedExtension

Replaced installedExtension with extension. Passes on osx and win xp
Attachment #418856 - Attachment is obsolete: true
Attachment #421328 - Flags: review?(hskupin)
Comment on attachment 421328 [details] [diff] [review]
update without installedExtension

This test has never be tested before asking for review. There are a couple of issues which causes failures at any time.

For this time I will fix those problems and attach an updated patch. But please run the test the next time. Thanks!
Attachment #421328 - Flags: review?(hskupin) → review-
Created attachment 421657 [details] [diff] [review]
Update test

A partial diff can be found here: http://pastebin.mozilla.org/697105

What has been updated:
* The installation is triggered lazily. Means the modal sheet doesn't appear immediately
* After the installation we would have to directly wait for the restart button to appear
* We would have to check the entry in the installation pane and not inside the Get Addons pane
* For the 2nd test the shared module path was wrong
* Some other minor fixes
Attachment #421657 - Flags: review?(adesai)

Comment 14

9 years ago
Comment on attachment 421657 [details] [diff] [review]
Update test

Ah, understood. This passes for me. Thanks for the help, henrik.
Attachment #421657 - Flags: review?(adesai) → review+
So I have checked the appropriate Litmus test again and noticed that the test is still missing the multiple installation test. Whether we should move this out to another Litmus test or it still needs to be implemented.

Comment 16

9 years ago
We should move that to another litmus test

Comment 17

9 years ago
litmus testcases 9861 and 9862 added for installing multiplex extensions and bug https://bugzilla.mozilla.org/show_bug.cgi?id=540445 created for creating a testscript for this litmus testcases.
Landed as:

I had to make some small modifications so the test will work on Windows when the .net Framework Add-on is installed too. Further I have added the closing of the Add-ons Manager window for the testSearchAddons.js test.
Last Resolved: 9 years ago
Resolution: --- → FIXED
Mass 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.
Component: Add-ons Manager → Mozmill Tests
Product: Toolkit → Mozilla QA
QA Contact: add-ons.manager → mozmill-tests
You need to log in before you can comment on or make changes to this bug.