Closed Bug 525281 Opened 15 years ago Closed 15 years ago

[mozmill] Test Addon Installation

Categories

(Mozilla QA Graveyard :: Mozmill Tests, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: aakashd, Assigned: aakashd)

References

Details

(Whiteboard: [MozMill1.3Testday])

Attachments

(3 files, 6 obsolete files)

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
 */
Attached file wip_patch (obsolete) —
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)
Whiteboard: [MozMill1.3Testday]
Attachment #409143 - Attachment is patch: false
Attachment #409143 - Flags: review?(hskupin) → review-
Comment on attachment 409143 [details]
wip_patch

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.
Attached patch wip_patch_v2 (obsolete) — Splinter 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.
Depends on: 534070
Attached patch patch (obsolete) — Splinter 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)
Attached patch Patch (corrected) (obsolete) — Splinter Review
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.
Attached patch patch with addonsAPI (obsolete) — Splinter Review
testscript with addonsAPI changes
Attachment #417841 - Attachment is obsolete: true
Attachment #418741 - Flags: review?(hskupin)
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+
Attachment #418741 - Attachment is obsolete: true
Attachment #418856 - Flags: review?(hskupin)
Attachment #418856 - Flags: review?(hskupin) → review-
Status: NEW → ASSIGNED
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-
Attached patch Update testSplinter Review
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 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.
We should move that to another litmus test
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:
http://hg.mozilla.org/qa/mozmill-tests/rev/f75345895973
http://hg.mozilla.org/qa/mozmill-tests/rev/9504495f4876

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.
Status: ASSIGNED → RESOLVED
Closed: 15 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
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: