<> ||<>|| = Oxford Automation Sprint - 2009 = === Gnome Menu Application Launching === * Assignees * cgregan * jcollado === Specification for Automation === * Desktop * Dynamically collect the applications in the gnome-menu * Generate scripts based on the app names collected * Execute generated scripts * Report any failures in app launch * Report any failure in app close * Future * Extend test depth to exercise more app functions === Problems found === * Accessibility information UNR launcher doesn't provide accessibility information so it's not possible to automate the task of collecting all the applications for which there's an icon that might be clicked using LDTP. [[https://bugs.launchpad.net/netbook-remix-launcher/+bug/341048|Bug#341048]] has been opened, but this won't be fixed, at least in the short-term, because launcher is based on [[http://www.clutter-project.org|clutter]], which doesn't provide any support to add accessibility information. As an alternative, the [[https://launchpad.net/desktop-switcher|desktop-switcher]] application has been tried to get the menu information from the standard ubuntu menu. Unfortunately this information is not available also in the version included in jaunty so this solution isn't acceptable for now. The only feasible solution at the moment seems to be parsing `.desktop` files in `/usr/share/applications` using `gnome-menus` and call the applications using the `Exec` tag from those files to launch the application. This solution should work, but it must be noted that the automated tests won't check that the click action in the menu icons work. A simple script that will get the list of applications as explained is displayed below: {{{#!python #!/usr/bin/python """ Simple python script that shows how to get the list of currently installed applications listed in the menu using gmenu """ import sys, optparse, gmenu def main(argv): options = parse_options(argv) tree = gmenu.lookup_tree(options.menu) root = tree.root applications = [] if isinstance(root, gmenu.Directory): add_directory_apps(root, applications) for app in applications: print ("Name: '%s'\n" "Exec: '%s'" % (app.get_name(), app.get_exec())) def add_directory_apps(dir, apps): """ Explore directories recursively and append every application found in to the list of applications """ contents = dir.get_contents() for object in contents: if isinstance(object, gmenu.Directory): add_directory_apps(object, apps) elif isinstance(object, gmenu.Entry): apps.append(object) else: print >> sys.stderr, "Skipping %s" % object def parse_options(argv): parser = optparse.OptionParser() parser.add_option('-m', '--menu', default='applications.menu', help=("Menu file to be used as root of the tree" "('%default' by default)")) (options, args) = parser.parse_args(argv) return options if __name__ == "__main__": main(sys.argv) }}}