diff options
author | Vadim Rutkovsky <vrutkovs@redhat.com> | 2014-04-24 19:52:35 +0800 |
---|---|---|
committer | Vadim Rutkovsky <vrutkovs@redhat.com> | 2014-04-24 20:24:08 +0800 |
commit | f6d59b3008cb3a41a160ec018761108d042d3159 (patch) | |
tree | f7f53541d58927fffa0c50bbbdaf16e307ce2ae3 /tests/steps | |
parent | fe557979e02253ea4a3a4bfecd8f8badc4c72fea (diff) | |
download | gsoc2013-evolution-f6d59b3008cb3a41a160ec018761108d042d3159.tar gsoc2013-evolution-f6d59b3008cb3a41a160ec018761108d042d3159.tar.gz gsoc2013-evolution-f6d59b3008cb3a41a160ec018761108d042d3159.tar.bz2 gsoc2013-evolution-f6d59b3008cb3a41a160ec018761108d042d3159.tar.lz gsoc2013-evolution-f6d59b3008cb3a41a160ec018761108d042d3159.tar.xz gsoc2013-evolution-f6d59b3008cb3a41a160ec018761108d042d3159.tar.zst gsoc2013-evolution-f6d59b3008cb3a41a160ec018761108d042d3159.zip |
tests: when switching tabs make sure required service is running
Diffstat (limited to 'tests/steps')
-rw-r--r-- | tests/steps/steps.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/steps/steps.py b/tests/steps/steps.py index 6a600e149b..78b19d2f7f 100644 --- a/tests/steps/steps.py +++ b/tests/steps/steps.py @@ -5,6 +5,7 @@ from dogtail.tree import root from dogtail.rawinput import keyCombo from time import sleep from os import system +from gi.repository import Gio @step(u'Help section "{name}" is displayed') @@ -47,6 +48,28 @@ def open_section_by_name(context, section_name): context.app.menu('View').menu('Window').point() context.app.menu('View').menu('Window').menuItem(section_name).click() + # Check that service required for this sections is running + required_services = { + 'Mail': 'org.gnome.evolution.dataserver.Sources', + 'Calendar': 'org.gnome.evolution.dataserver.Calendar', + 'Tasks': 'org.gnome.evolution.dataserver.Calendar', + 'Memos': 'org.gnome.evolution.dataserver.Calendar', + 'Contacts': 'org.gnome.evolution.dataserver.AddressBook', + } + required_service = required_services[section_name] + bus = Gio.bus_get_sync(Gio.BusType.SESSION, None) + dbus_proxy = Gio.DBusProxy.new_sync(bus, Gio.DBusProxyFlags.NONE, None, + 'org.freedesktop.DBus', + '/org/freedesktop/DBus', + 'org.freedesktop.DBus', None) + for attempt in xrange(0, 10): + result = dbus_proxy.call_sync( + 'ListNames', None, Gio.DBusCallFlags.NO_AUTO_START, 500, None) + sleep(1) + if True in [required_service in x for x in result[0]]: + return + raise RuntimeError("%s service was not found" % required_service) + @step(u'"{name}" menu is opened') def menu_is_opened(context, name): |