A crucial part of test automation is the fact that you can install and uninstall the application under test. While the installer part for Gecko based applications was already included in MozInstall we missed the uninstaller feature. I have added this feature now for the 1.0 release. On Windows it will first try to run the Firefox uninstaller in silent mode to remove any trace even from the registry. If files remain or if you are on another platform the specified folder will just be wiped out.
This work is part of our overall code rewrite of the Mozmill Automation scripts for Mozmill 2.0, whereby a lot of useful code will be merged with existing mozbase packages, or new packages like the mozdownload one will be created.
Keep in mind that this release changes the API of several functions. We are aware of that and hope that everyone of you will be able to adapt to it easily. It was necessary before more and more projects rely on this package. For any details please see the appropriate README file. Otherwise here some examples:
$ cd /Volumes/mozilla/builds/ $ mozinstall firefox-13.0-en-US.dmg /Volumes/mozilla/builds/FirefoxAurora.app/Contents/MacOS/firefox $ mozuninstall firefox/
With those two commands the specified DMG image of Firefox 13 will be installed into a sub folder of the current working directory and removed right after. The installer will print the location of the actual binary to stdout.
import mozinstall path = mozinstall.install('firefox-13.0-en-US.exe) print mozinstall.get_binary(path, 'firefox') mozinstall.uninstall(path)
This code is the equivalent to the CLI example above. It installs Firefox into a sub folder of the current working directory, and returns the path. With the call to get_binary and by specifying the type of application, the actual binary will be returned. Replace ‘firefox’ with ‘thunderbird’ if you want to install a Thunderbird build. Finally the uninstaller expects the path Firefox has been installed into, and removes the application.