~cimi/ubuntu-system-settings/wizard.privacy

« back to all changes in this revision

Viewing changes to tests/autopilot/ubuntu_system_settings/tests/__init__.py

  • Committer: Andrea Cimitan
  • Date: 2014-04-11 12:07:23 UTC
  • mfrom: (662.2.47 wizard.wifi)
  • Revision ID: andrea.cimitan@gmail.com-20140411120723-hzbv5ekjurprc6uw
* Bump version for new package ubuntu-system-settings-wizard
[ Andrea Cimitan ]
* Detect SIM and if negative show no sim page
[ Victor R. Ruiz ]
* Autopilot: Move launch_system_settings to a helper module.
[ Iain Lane ]
* Hide 'Serial' and 'IMEI' entries when the info isn't available
* Don't look for PkgConfig explicitly, breaks with Multi-Arch.
  FindPkgConfig.cmake does this for us anyway.
[ CI bot ]
* Resync trunk
[ Diego Sarmentero ]
* Add click updates support. .

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
from __future__ import absolute_import
11
11
 
12
12
from ubuntu_system_settings.utils.i18n import ugettext as _
 
13
from ubuntu_system_settings import helpers
13
14
 
14
15
from autopilot.input import Mouse, Touch, Pointer
15
16
from autopilot.platform import model
34
35
 
35
36
    def setUp(self, panel=None):
36
37
        super(UbuntuSystemSettingsTestCase, self).setUp()
37
 
        self.launch_system_settings(panel=panel)
 
38
        self.app = helpers.launch_system_settings(self, panel=panel)
38
39
        self.assertThat(self.main_view.visible, Eventually(Equals(True)))
39
40
 
40
 
    def launch_system_settings(self, panel=None):
41
 
        params = ['/usr/bin/system-settings']
42
 
        if (model() != 'Desktop'):
43
 
            params.append('--desktop_file_hint=/usr/share/applications/'
44
 
                          'ubuntu-system-settings.desktop')
45
 
 
46
 
        # Launch to a specific panel
47
 
        if panel is not None:
48
 
            params.append(panel)
49
 
 
50
 
        self.app = self.launch_test_application(
51
 
            *params,
52
 
            app_type='qt',
53
 
            emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase)
54
 
 
55
41
    @property
56
42
    def main_view(self):
57
43
        """ Return main view """
107
93
    def setUp(self):
108
94
        super(UbuntuSystemSettingsBatteryTestCase, self).setUp()
109
95
        self.add_mock_battery()
110
 
        self.launch_system_settings()
 
96
        self.app = helpers.launch_system_settings(self)
111
97
        self.assertThat(self.main_view.visible, Eventually(Equals(True)))
112
98
 
113
99
 
241
227
        button = self.main_view.select_single(
242
228
            objectName='entryComponent-system-update')
243
229
        self.assertThat(button, NotEquals(None))
244
 
        self.pointer.move_to_object(button)
245
 
        self.pointer.click()
 
230
        self.scroll_to_and_click(button)
246
231
 
247
232
    @property
248
233
    def updates_page(self):
249
234
        """ Return 'System Update' page """
250
 
        return self.main_view.select_single(
251
 
            objectName='entryComponent-system-update')
 
235
        return self.main_view.select_single(objectName='systemUpdatesPage')