1
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
3
# Copyright (C) 2013, 2014 Canonical Ltd.
5
# This file is part of ubuntu-system-settings-online-accounts.
7
# ubuntu-system-settings-online-accounts is free software: you can
8
# redistribute it and/or modify it under the terms of the GNU General Public
9
# License as published by the Free Software Foundation; version 3.
11
# ubuntu-system-settings-online-accounts is distributed in the hope that it
12
# will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU General Public License for more details.
16
# You should have received a copy of the GNU General Public License
17
# along with this program. If not, see <http://www.gnu.org/licenses/>.
23
import ubuntuuitoolkit
24
from autopilot import platform
25
from autopilot.matchers import Eventually
26
from testtools.matchers import Equals
28
import online_accounts_ui
31
class BaseOnlineAccountsUITestCase(
32
ubuntuuitoolkit.base.UbuntuUIToolkitAppTestCase):
35
super(BaseOnlineAccountsUITestCase, self).setUp()
37
if platform.model() != 'Desktop':
38
self.skipTest('Skip because of bug http://pad.lv/1252294')
40
application_proxy = self.launch_application()
41
self.application = online_accounts_ui.OnlineAccountsUI(
44
self.application.main_view.visible, Eventually(Equals(True)))
46
def launch_application(self):
47
# Increase the timeout of online-accounts-ui, to make sure it won't
48
# quit before the system settings panel asks it to open.
50
fixtures.EnvironmentVariable('OAU_DAEMON_TIMEOUT', '120'))
51
application = self.launch_test_application(
53
'--desktop_file_hint='
54
'/usr/share/applications/online-accounts-ui.desktop',
56
emulator_base=ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase,
58
system_settings = subprocess.Popen(
59
['system-settings', 'online-accounts',
60
'--desktop_file_hint='
61
'/usr/share/applications/ubuntu-system-settings.desktop'])
62
self.addCleanup(system_settings.terminate)