Merge lp:~elopio/ubuntu-system-settings/refactor_about_tests into lp:ubuntu-system-settings

Proposed by Leo Arias
Status: Superseded
Proposed branch: lp:~elopio/ubuntu-system-settings/refactor_about_tests
Merge into: lp:ubuntu-system-settings
Prerequisite: lp:~elopio/ubuntu-system-settings/python3
Diff against target: 707 lines (+320/-149)
7 files modified
tests/autopilot/ubuntu_system_settings/__init__.py (+152/-27)
tests/autopilot/ubuntu_system_settings/tests/__init__.py (+46/-56)
tests/autopilot/ubuntu_system_settings/tests/test_about.py (+67/-47)
tests/autopilot/ubuntu_system_settings/tests/test_cellular.py (+17/-5)
tests/autopilot/ubuntu_system_settings/tests/test_datetime.py (+4/-3)
tests/autopilot/ubuntu_system_settings/tests/test_search.py (+16/-6)
tests/autopilot/ubuntu_system_settings/tests/test_sound.py (+18/-5)
To merge this branch: bzr merge lp:~elopio/ubuntu-system-settings/refactor_about_tests
Reviewer Review Type Date Requested Status
Brendan Donegan (community) Approve
Sebastien Bacher (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+225425@code.launchpad.net

This proposal has been superseded by a proposal from 2014-07-11.

Commit message

Refactored the About autopilot tests to use the page object pattern. Added the click_item public helper to be used by UX tests.

To post a comment you must log in.
761. By Leo Arias

Removed the unnecessary class.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:760
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/923/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/1513
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/1309
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/115
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/115
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/115/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/115
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/1795
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2490
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2490/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/9224
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1080
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1469
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1469/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-system-settings-ci/923/rebuild

review: Needs Fixing (continuous-integration)
762. By Leo Arias

Fixed the licenses.

763. By Leo Arias

Fixed the licenses.

764. By Leo Arias

Fixed the licenses.

765. By Leo Arias

Fixed the licenses.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:761
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/924/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/1515
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/1310
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/116
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/116
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/116/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/116
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/1797
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2494
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2494/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/9229
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1081
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1472
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1472/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-system-settings-ci/924/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:765
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/925/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/1517
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/1312
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/117
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/117
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/117/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/117
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/1799
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2496
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2496/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/9231
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1083
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1475
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1475/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-system-settings-ci/925/rebuild

review: Needs Fixing (continuous-integration)
766. By Leo Arias

Merged with prerequisite.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:767
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/949/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/1727
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/1460
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/141
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/141
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/141/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/141
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/1989
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2773
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2773/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/9502
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1217
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1632
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1632/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-system-settings-ci/949/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:767
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/955/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/1767
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/1487
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/147
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/147
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/147/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/147
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2025
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2829
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2829/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/9557
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1243
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1669
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1669/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-system-settings-ci/955/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:767
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/956/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/1778
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/1494
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/148
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/148
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/148/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/148
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2040
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2845
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2845/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/9578
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1250
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1679
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1679/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-system-settings-ci/956/rebuild

review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:767
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/957/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/1781
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/1497
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/149
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/149
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/149/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/149
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2045
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2848
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2848/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/9584
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1253
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1683
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1683/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-system-settings-ci/957/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:767
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/958/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/1784
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/1500
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/150
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/150
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/150/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/150
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2047
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2852
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2852/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/9586
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1256
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1687
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1687/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-system-settings-ci/958/rebuild

review: Approve (continuous-integration)
Revision history for this message
Sebastien Bacher (seb128) wrote :

thanks, looks fine to me

review: Approve
Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

Great - thanks!

review: Approve
767. By Leo Arias

Merged with jonas branch.

768. By Leo Arias

Reverted the license changes for now.

769. By Leo Arias

Merged with trunk.

770. By Leo Arias

Updated the pointing device attribute.

771. By Leo Arias

Added the CellularPage to make the tests work with jonas' additions

772. By Leo Arias

Merged with trunk.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tests/autopilot/ubuntu_system_settings/__init__.py'
--- tests/autopilot/ubuntu_system_settings/__init__.py 2014-07-09 00:25:18 +0000
+++ tests/autopilot/ubuntu_system_settings/__init__.py 2014-07-09 00:25:18 +0000
@@ -2,17 +2,20 @@
2#2#
3# Copyright (C) 2014 Canonical Ltd.3# Copyright (C) 2014 Canonical Ltd.
4#4#
5# This program is free software; you can redistribute it and/or modify5#
6# it under the terms of the GNU Lesser General Public License as published by6# This file is part of ubuntu-system-settings
7#
8# ubuntu-system-settings is free software: you can redistribute it and/or
9# modify it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; version 3.10# the Free Software Foundation; version 3.
8#11#
9# This program is distributed in the hope that it will be useful,12# ubuntu-system-settings is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of13# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU Lesser General Public License for more details.15# GNU General Public License for more details.
13#16#
14# You should have received a copy of the GNU Lesser General Public License17# You should have received a copy of the GNU General Public License
15# along with this program. If not, see <http://www.gnu.org/licenses/>.18# along with this program. If not, see <http://www.gnu.org/licenses/>.
1619
17import logging20import logging
1821
@@ -23,8 +26,12 @@
2326
24from time import sleep27from time import sleep
2528
26from autopilot import platform29import autopilot.logging
27from ubuntuuitoolkit import emulators as toolkit_emulators30import ubuntuuitoolkit
31from autopilot import introspection, platform
32
33
34logger = logging.getLogger(__name__)
2835
2936
30class SystemSettings():37class SystemSettings():
@@ -72,7 +79,7 @@
72 app = testobj.launch_test_application(79 app = testobj.launch_test_application(
73 *params,80 *params,
74 app_type='qt',81 app_type='qt',
75 emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase)82 emulator_base=ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase)
7683
77 return app84 return app
7885
@@ -82,13 +89,34 @@
82 return self.app.select_single(MainWindow)89 return self.app.select_single(MainWindow)
8390
8491
85class MainWindow(toolkit_emulators.MainView):92class MainWindow(ubuntuuitoolkit.MainView):
86 """An emulator class that makes it easy to interact with the UI."""93 """An emulator class that makes it easy to interact with the UI."""
8794
88 @property95 @autopilot.logging.log_action(logger.debug)
89 def pointer(self):96 def click_item(self, object_name):
90 """ Return pointer """97 """Click a system settings item.
91 return toolkit_emulators.get_pointing_device()98
99 :param object_name: The objectName property of the item to click.
100
101 """
102 item = self.select_single(objectName=object_name)
103 item.swipe_into_view()
104 self.pointing_device.click_object(item)
105
106 @autopilot.logging.log_action(logger.info)
107 def go_to_about_page(self):
108 """Open the About page.
109
110 :return: The About page.
111
112 """
113 return self._go_to_page('entryComponent-about', 'aboutPage')
114
115 def _go_to_page(self, item_object_name, page_object_name):
116 self.click_item(item_object_name)
117 page = self.wait_select_single(objectName=page_object_name)
118 page.active.wait_for(True)
119 return page
92120
93 def scroll_to(self, obj):121 def scroll_to(self, obj):
94 page = self.select_single(objectName='systemSettingsPage')122 page = self.select_single(objectName='systemSettingsPage')
@@ -97,7 +125,7 @@
97 page_center_x = int(page_right / 2)125 page_center_x = int(page_right / 2)
98 page_center_y = int(page_bottom / 2)126 page_center_y = int(page_bottom / 2)
99 while obj.globalRect[1] + obj.height > page_bottom:127 while obj.globalRect[1] + obj.height > page_bottom:
100 self.pointer.drag(128 self.pointing_device.drag(
101 page_center_x,129 page_center_x,
102 page_center_y,130 page_center_y,
103 page_center_x,131 page_center_x,
@@ -108,12 +136,7 @@
108136
109 def scroll_to_and_click(self, obj):137 def scroll_to_and_click(self, obj):
110 self.scroll_to(obj)138 self.scroll_to(obj)
111 self.pointer.click_object(obj)139 self.pointing_device.click_object(obj)
112
113 @property
114 def about_page(self):
115 """ Return 'About' page """
116 return self.select_single(objectName='aboutPage')
117140
118 @property141 @property
119 def cellular_page(self):142 def cellular_page(self):
@@ -126,11 +149,6 @@
126 return self.select_single(objectName="chooseCarrierPage")149 return self.select_single(objectName="chooseCarrierPage")
127150
128 @property151 @property
129 def licenses_page(self):
130 """ Return 'License' page """
131 return self.select_single(objectName='licensesPage')
132
133 @property
134 def storage_page(self):152 def storage_page(self):
135 """ Return 'Storage' page """153 """ Return 'Storage' page """
136 return self.select_single(objectName='storagePage')154 return self.select_single(objectName='storagePage')
@@ -144,3 +162,110 @@
144 def sound_page(self):162 def sound_page(self):
145 """ Return 'Sound' page """163 """ Return 'Sound' page """
146 return self.select_single(objectName='soundPage')164 return self.select_single(objectName='soundPage')
165
166
167class SoundPage(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
168
169 """Autopilot helper for the Sound page."""
170
171 @classmethod
172 def validate_dbus_object(cls, path, state):
173 name = introspection.get_classname_from_path(path)
174 if name == b'ItemPage':
175 if state['objectName'][1] == 'soundPage':
176 return True
177 return False
178
179
180class AboutPage(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
181
182 """Autopilot helper for the About page."""
183
184 @classmethod
185 def validate_dbus_object(cls, path, state):
186 name = introspection.get_classname_from_path(path)
187 if name == b'ItemPage':
188 if state['objectName'][1] == 'aboutPage':
189 return True
190 return False
191
192 def get_device_name(self):
193 device_label = self.select_single(objectName='deviceLabel')
194 return device_label.text
195
196 def is_serial_visible(self):
197 serial_item = self._get_serial_item()
198 return serial_item.visible
199
200 def _get_serial_item(self):
201 return self.select_single(objectName='serialItem')
202
203 def get_serial(self):
204 serial_item = self._get_serial_item()
205 return serial_item.value
206
207 def is_imei_visible(self):
208 imei_item = self._get_imei_item()
209 return imei_item.visible
210
211 def _get_imei_item(self):
212 return self.wait_select_single(objectName='imeiItem')
213
214 def get_imei(self):
215 imei_item = self._get_imei_item()
216 return imei_item.value
217
218 def get_os_information(self):
219 os_item = self.select_single(objectName='osItem')
220 return os_item.value
221
222 def get_last_updated_date(self):
223 last_updated_item = self.select_single(objectName='lastUpdatedItem')
224 return last_updated_item.value
225
226 @autopilot.logging.log_action(logger.info)
227 def go_to_check_for_updates(self):
228 check_for_updates_button = self.select_single(
229 objectName='updateButton')
230 self.pointing_device.click_object(check_for_updates_button)
231 system_updates_page = self.get_root_instance().wait_select_single(
232 objectName='systemUpdatesPage')
233 system_updates_page.active.wait_for(True)
234 return system_updates_page
235
236 @autopilot.logging.log_action(logger.info)
237 def go_to_software_licenses(self):
238 license_item = self.select_single(
239 ubuntuuitoolkit.listitems.Standard, objectName='licenseItem')
240 license_item.swipe_into_view()
241 self.pointing_device.click_object(license_item)
242 licenses_page = self.get_root_instance().wait_select_single(
243 objectName='licensesPage')
244 licenses_page.active.wait_for(True)
245 return licenses_page
246
247
248class LicensesPage(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
249
250 """Autopilot helper for the Licenses page."""
251
252 @classmethod
253 def validate_dbus_object(cls, path, state):
254 name = introspection.get_classname_from_path(path)
255 if name == b'ItemPage':
256 if state['objectName'][1] == 'licensesPage':
257 return True
258 return False
259
260
261class SystemUpdatesPage(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
262
263 """Autopilot helper for the System Updates page."""
264
265 @classmethod
266 def validate_dbus_object(cls, path, state):
267 name = introspection.get_classname_from_path(path)
268 if name == b'ItemPage':
269 if state['objectName'][1] == 'systemUpdatesPage':
270 return True
271 return False
147272
=== modified file 'tests/autopilot/ubuntu_system_settings/tests/__init__.py'
--- tests/autopilot/ubuntu_system_settings/tests/__init__.py 2014-06-11 09:36:44 +0000
+++ tests/autopilot/ubuntu_system_settings/tests/__init__.py 2014-07-09 00:25:18 +0000
@@ -1,35 +1,42 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2# Copyright 2013 Canonical2#
3#3# Copyright 2013, 2014 Canonical
4# This program is free software: you can redistribute it and/or modify it4#
5# under the terms of the GNU General Public License version 3, as published5# This file is part of ubuntu-system-settings
6# by the Free Software Foundation.6#
7# ubuntu-system-settings is free software: you can redistribute it and/or
8# modify it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; version 3.
10#
11# ubuntu-system-settings is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
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/>.
18
719
8""" Tests for Ubuntu System Settings """20""" Tests for Ubuntu System Settings """
921
10from __future__ import absolute_import22from __future__ import absolute_import
1123
12from ubuntu_system_settings import SystemSettings
13
14from autopilot.input import Mouse, Touch
15from autopilot.platform import model
16from autopilot.matchers import Eventually
17from testtools.matchers import Equals, NotEquals, GreaterThan
18
19from ubuntuuitoolkit.base import UbuntuUIToolkitAppTestCase
2024
21import dbus25import dbus
22import dbusmock26import dbusmock
23import subprocess27import subprocess
2428
2529import ubuntuuitoolkit
26class UbuntuSystemSettingsTestCase(UbuntuUIToolkitAppTestCase):30from autopilot.matchers import Eventually
27 """ Base class for Ubuntu System Settings """31from testtools.matchers import Equals, NotEquals, GreaterThan
2832
29 if model() == 'Desktop':33from ubuntu_system_settings import SystemSettings
30 scenarios = [('with mouse', dict(input_device_class=Mouse))]34
31 else:35
32 scenarios = [('with touch', dict(input_device_class=Touch))]36class UbuntuSystemSettingsTestCase(
37 ubuntuuitoolkit.base.UbuntuUIToolkitAppTestCase):
38
39 """Base class for Ubuntu System Settings."""
3340
34 def setUp(self, panel=None):41 def setUp(self, panel=None):
35 super(UbuntuSystemSettingsTestCase, self).setUp()42 super(UbuntuSystemSettingsTestCase, self).setUp()
@@ -128,28 +135,23 @@
128135
129136
130class AboutBaseTestCase(UbuntuSystemSettingsTestCase):137class AboutBaseTestCase(UbuntuSystemSettingsTestCase):
131 """ Base class for About this phone tests """138
139 """Base class for About this phone tests."""
132140
133 def setUp(self):141 def setUp(self):
134 """ Go to About page """142 """Go to About page."""
135 super(AboutBaseTestCase, self).setUp('about')143 super(AboutBaseTestCase, self).setUp()
136 self.assertThat(self.system_settings.main_view.about_page.active,144 self.about_page = self.system_settings.main_view.go_to_about_page()
137 Eventually(Equals(True)))
138145
139146
140class StorageBaseTestCase(AboutBaseTestCase):147class StorageBaseTestCase(AboutBaseTestCase):
141 """ Base class for Storage page tests """148
149 """Base class for Storage page tests."""
142150
143 def setUp(self):151 def setUp(self):
144 """ Go to Storage Page """152 """Go to Storage Page."""
145 super(StorageBaseTestCase, self).setUp()153 super(StorageBaseTestCase, self).setUp()
146 # Click on 'Storage' option154 self.system_settings.main_view.click_item('storageItem')
147 button = self.system_settings.main_view.about_page.select_single(
148 'Standard',
149 objectName='storageItem'
150 )
151 self.assertThat(button, NotEquals(None))
152 self.system_settings.main_view.scroll_to_and_click(button)
153 self.assertThat(self.storage_page.active, Eventually(Equals(True)))155 self.assertThat(self.storage_page.active, Eventually(Equals(True)))
154156
155 def assert_space_item(self, object_name, text):157 def assert_space_item(self, object_name, text):
@@ -180,36 +182,24 @@
180182
181183
182class LicenseBaseTestCase(AboutBaseTestCase):184class LicenseBaseTestCase(AboutBaseTestCase):
183 """ Base class for Licenses page tests """185
186 """Base class for Licenses page tests."""
184187
185 def setUp(self):188 def setUp(self):
186 """ Go to License Page """189 """Go to License Page."""
187 super(LicenseBaseTestCase, self).setUp()190 super(LicenseBaseTestCase, self).setUp()
188 # Click on 'Software licenses' option191 self.licenses_page = self.about_page.go_to_software_licenses()
189 button = self.system_settings.main_view.select_single(
190 'Standard',
191 objectName='licenseItem')
192 self.system_settings.main_view.scroll_to_and_click(button)
193
194 @property
195 def licenses_page(self):
196 """ Return 'License' page """
197 return self.main_view.wait_select_single(
198 'ItemPage', objectName='licensesPage'
199 )
200192
201193
202class SystemUpdatesBaseTestCase(UbuntuSystemSettingsTestCase):194class SystemUpdatesBaseTestCase(UbuntuSystemSettingsTestCase):
203 """ Base class for SystemUpdates page tests """195
196 """Base class for SystemUpdates page tests."""
204197
205 def setUp(self):198 def setUp(self):
206 """ Go to SystemUpdates Page """199 """Go to SystemUpdates Page."""
207 super(SystemUpdatesBaseTestCase, self).setUp()200 super(SystemUpdatesBaseTestCase, self).setUp()
208 # Click on 'System Updates' option201 self.system_settings.main_view.click_item(
209 button = self.system_settings.main_view.select_single(202 'entryComponent-system-update')
210 objectName='entryComponent-system-update')
211 self.assertThat(button, NotEquals(None))
212 self.system_settings.main_view.scroll_to_and_click(button)
213203
214204
215class SoundBaseTestCase(UbuntuSystemSettingsTestCase):205class SoundBaseTestCase(UbuntuSystemSettingsTestCase):
216206
=== modified file 'tests/autopilot/ubuntu_system_settings/tests/test_about.py'
--- tests/autopilot/ubuntu_system_settings/tests/test_about.py 2014-07-09 00:25:18 +0000
+++ tests/autopilot/ubuntu_system_settings/tests/test_about.py 2014-07-09 00:25:18 +0000
@@ -1,9 +1,20 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2# Copyright 2013 Canonical2#
3#3# Copyright 2013, 2014 Canonical
4# This program is free software: you can redistribute it and/or modify it4#
5# under the terms of the GNU General Public License version 3, as published5# This file is part of ubuntu-system-settings
6# by the Free Software Foundation.6#
7# ubuntu-system-settings is free software: you can redistribute it and/or
8# modify it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; version 3.
10#
11# ubuntu-system-settings is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
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/>.
718
8import os19import os
9import subprocess20import subprocess
@@ -27,7 +38,8 @@
2738
2839
29class AboutTestCase(AboutBaseTestCase):40class AboutTestCase(AboutBaseTestCase):
30 """ Tests for About this phone Page """41
42 """Tests for About this phone Page."""
3143
32 def _get_imei_from_dbus(self):44 def _get_imei_from_dbus(self):
33 bus = dbus.SystemBus()45 bus = dbus.SystemBus()
@@ -93,37 +105,48 @@
93 else:105 else:
94 return str(info.split()[0])106 return str(info.split()[0])
95107
96 def test_serial(self):108 def test_device_with_serial_number_must_display_it(self):
97 """Checks whether the UI is showing the correct serial number."""109 """Checks whether the UI is showing the correct serial number."""
98 item = self.system_settings.main_view.about_page.select_single(110 device_serial = self._get_device_serial_number()
99 objectName='serialItem'111 if not device_serial:
100 )112 self.skipTest('The device has no serial number.')
101 serial = self._get_device_serial_number()
102
103 if not serial:
104 self.assertThat(item.visible, Equals(False))
105 else:113 else:
114 self.assertTrue(self.about_page.is_serial_visible())
115 displayed_serial = self.about_page.get_serial()
106 self.assertThat(116 self.assertThat(
107 item.value, Equals(self._get_device_serial_number())117 displayed_serial, Equals(device_serial))
108 )118
109119 def test_device_without_serial_must_not_display_it(self):
110 def test_imei_information_is_correct(self):120 device_serial = self._get_device_serial_number()
121 if device_serial:
122 self.skipTest('The device has serial number.')
123 else:
124 self.assertFalse(self.about_page.is_serial_visible())
125
126 def test_device_with_imei_must_display_it(self):
111 """Checks whether the UI is exposing the right IMEI."""127 """Checks whether the UI is exposing the right IMEI."""
112 imei_item = self.system_settings.main_view.about_page.wait_select_single(128 device_imei = self._get_imei_from_dbus()
113 objectName='imeiItem')129 if not device_imei:
114 imei_ofono = self._get_imei_from_dbus()130 self.skipTest('The device has no imei.')
131 else:
132 self.assertTrue(self.about_page.is_imei_visible())
133 displayed_imei = self.about_page.get_imei()
134 self.assertThat(displayed_imei, Equals(device_imei))
115135
116 if not imei_ofono:136 def test_device_without_imei_must_not_display_it(self):
117 self.assertThat(imei_item.visible, Equals(False))137 device_imei = self._get_imei_from_dbus()
138 if device_imei:
139 self.skipTest('The device has imei.')
118 else:140 else:
119 self.assertEquals(imei_item.value, imei_ofono)141 self.assertFalse(self.about_page.is_imei_visible())
120142
121 def test_settings_show_correct_version_of_the_os(self):143 def test_settings_show_correct_version_of_the_os(self):
122 """Ensure the UI is showing the correct version of the OS."""144 """Ensure the UI is showing the correct version of the OS."""
123 item = self.system_settings.main_view.about_page.select_single(objectName='osItem')145 device_os_version = self._get_os_name()
146 displayed_os_info = self.about_page.get_os_information()
124 # TODO: find a way to check the image build number as well147 # TODO: find a way to check the image build number as well
125 # -- om26er 10-03-2014148 # -- om26er 10-03-2014
126 self.assertTrue(self._get_os_name() in item.value)149 self.assertTrue(device_os_version in displayed_os_info)
127150
128 @skipIf(subprocess.call(151 @skipIf(subprocess.call(
129 ['which', 'getprop'], stdout=subprocess.PIPE) != 0,152 ['which', 'getprop'], stdout=subprocess.PIPE) != 0,
@@ -131,31 +154,26 @@
131 )154 )
132 def test_hardware_name(self):155 def test_hardware_name(self):
133 """Ensure the UI is showing the correct device name."""156 """Ensure the UI is showing the correct device name."""
134 device_label = self.system_settings.main_view.about_page.select_single(157 displayed_device_name = self.about_page.get_device_name()
135 objectName='deviceLabel'
136 ).text
137 device_name_from_getprop = self._get_device_manufacturer_and_model()158 device_name_from_getprop = self._get_device_manufacturer_and_model()
138159
139 self.assertEquals(device_label, device_name_from_getprop)160 self.assertEquals(displayed_device_name, device_name_from_getprop)
140161
141 def test_last_updated(self):162 def test_last_updated(self):
142 """Checks whether Last Updated info is correct."""163 """Checks whether Last Updated info is correct."""
143 last_updated = self.system_settings.main_view.about_page.select_single(164 last_updated_date_displayed = self.about_page.get_last_updated_date()
144 objectName='lastUpdatedItem'165 self.assertEquals(
145 ).value166 last_updated_date_displayed, self._get_last_updated_date())
146
147 self.assertEquals(last_updated, self._get_last_updated_date())
148167
149 def test_check_for_updates(self):168 def test_check_for_updates(self):
150 """169 """
151 Checks whether clicking on Check for Updates brings us170 Checks whether clicking on Check for Updates brings us
152 to the Updates page.171 to the Updates page.
153 """172 """
154 update_button = self.system_settings.main_view.about_page.select_single(173 system_updates_page = self.about_page.go_to_check_for_updates()
155 objectName='updateButton')174 self.assertThat(
156 self.system_settings.main_view.pointer.click_object(update_button)175 system_updates_page.visible, Eventually(Equals(True)))
157 self.assertThat(self.system_settings.main_view.updates_page.visible,176
158 Eventually(Equals(True)))
159177
160class StorageTestCase(StorageBaseTestCase):178class StorageTestCase(StorageBaseTestCase):
161 """ Tests for Storage """179 """ Tests for Storage """
@@ -261,10 +279,12 @@
261279
262280
263class LicenseTestCase(LicenseBaseTestCase):281class LicenseTestCase(LicenseBaseTestCase):
264 """ Tests for Licenses """282
265283 """Tests for Licenses."""
266 def test_licenses_page(self):284
267 """ Check whether Storage page is available """285 def test_open_licenses_page(self):
268 self.assertThat(286 """Check whether Storage page is available."""
269 self.system_settings.main_view.licenses_page.active,287 # FIXME this is not a good Autopilot tests. It would be better if it
270 Eventually(Equals(True)))288 # opens one of the licenses and checks that it is visible.
289 # --elopio - 2014-07-02
290 self.assertThat(self.licenses_page.active, Equals(True))
271291
=== modified file 'tests/autopilot/ubuntu_system_settings/tests/test_cellular.py'
--- tests/autopilot/ubuntu_system_settings/tests/test_cellular.py 2014-07-09 00:25:18 +0000
+++ tests/autopilot/ubuntu_system_settings/tests/test_cellular.py 2014-07-09 00:25:18 +0000
@@ -1,9 +1,20 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2#
2# Copyright 2014 Canonical3# Copyright 2014 Canonical
3#4#
4# This program is free software: you can redistribute it and/or modify it5# This file is part of ubuntu-system-settings
5# under the terms of the GNU General Public License version 3, as published6#
6# by the Free Software Foundation.7# ubuntu-system-settings is free software: you can redistribute it and/or
8# modify it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; version 3.
10#
11# ubuntu-system-settings is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
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/>.
718
8from autopilot.introspection.dbus import StateNotFoundError19from autopilot.introspection.dbus import StateNotFoundError
9from testtools.matchers import Equals, NotEquals, raises20from testtools.matchers import Equals, NotEquals, raises
@@ -23,10 +34,11 @@
23 objectName="autoChooseCarrierSelector"34 objectName="autoChooseCarrierSelector"
24 )35 )
25 manual = selector.select_single('Label', text=_("Manually"))36 manual = selector.select_single('Label', text=_("Manually"))
26 self.system_settings.main_view.pointer.click_object(manual)37 self.system_settings.main_view.pointing_device.click_object(manual)
27 choosecarrier = self.system_settings.main_view.cellular_page.\38 choosecarrier = self.system_settings.main_view.cellular_page.\
28 select_single(objectName="chooseCarrier")39 select_single(objectName="chooseCarrier")
29 self.system_settings.main_view.pointer.click_object(choosecarrier)40 self.system_settings.main_view.pointing_device.click_object(
41 choosecarrier)
30 self.assertThat(42 self.assertThat(
31 self.system_settings.main_view.choose_page.title,43 self.system_settings.main_view.choose_page.title,
32 Equals(_("Carrier"))44 Equals(_("Carrier"))
3345
=== modified file 'tests/autopilot/ubuntu_system_settings/tests/test_datetime.py'
--- tests/autopilot/ubuntu_system_settings/tests/test_datetime.py 2014-06-12 10:33:31 +0000
+++ tests/autopilot/ubuntu_system_settings/tests/test_datetime.py 2014-07-09 00:25:18 +0000
@@ -65,7 +65,8 @@
65 text_field = self.system_settings.main_view.select_single(65 text_field = self.system_settings.main_view.select_single(
66 objectName='selectTimeZoneField'66 objectName='selectTimeZoneField'
67 )67 )
68 self.system_settings.main_view.pointer.move_to_object(text_field)68 self.system_settings.main_view.pointing_device.move_to_object(
69 text_field)
6970
70 def test_time_date_page(self):71 def test_time_date_page(self):
71 """ Checks whether Time & Date page is available """72 """ Checks whether Time & Date page is available """
@@ -108,7 +109,7 @@
108 objectName='locationsListView'109 objectName='locationsListView'
109 )110 )
110 london = TimeDateTestCase.wait_select_listview_first(listview)111 london = TimeDateTestCase.wait_select_listview_first(listview)
111 self.system_settings.main_view.pointer.click_object(london)112 self.system_settings.main_view.pointing_device.click_object(london)
112 header = self.system_settings.main_view.select_single(113 header = self.system_settings.main_view.select_single(
113 objectName='MainView_Header'114 objectName='MainView_Header'
114 )115 )
@@ -128,7 +129,7 @@
128 )129 )
129130
130 preston = TimeDateTestCase.wait_select_listview_first(listview)131 preston = TimeDateTestCase.wait_select_listview_first(listview)
131 self.system_settings.main_view.pointer.click_object(preston)132 self.system_settings.main_view.pointing_device.click_object(preston)
132133
133 # The timer is 1 second, wait and see that we haven't moved pages134 # The timer is 1 second, wait and see that we haven't moved pages
134 sleep(2)135 sleep(2)
135136
=== modified file 'tests/autopilot/ubuntu_system_settings/tests/test_search.py'
--- tests/autopilot/ubuntu_system_settings/tests/test_search.py 2014-05-27 15:56:15 +0000
+++ tests/autopilot/ubuntu_system_settings/tests/test_search.py 2014-07-09 00:25:18 +0000
@@ -1,11 +1,21 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2# Copyright 2013 Canonical2#
3#3# Copyright 2013, 2014 Canonical
4# This program is free software: you can redistribute it and/or modify it4#
5# under the terms of the GNU General Public License version 3, as published5# This file is part of ubuntu-system-settings
6# by the Free Software Foundation.6#
7# ubuntu-system-settings is free software: you can redistribute it and/or
8# modify it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; version 3.
10#
11# ubuntu-system-settings is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
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/>.
718
8from autopilot.introspection.dbus import StateNotFoundError
9from testtools.matchers import Equals19from testtools.matchers import Equals
10from autopilot.matchers import Eventually20from autopilot.matchers import Eventually
1121
1222
=== modified file 'tests/autopilot/ubuntu_system_settings/tests/test_sound.py'
--- tests/autopilot/ubuntu_system_settings/tests/test_sound.py 2014-06-11 09:38:03 +0000
+++ tests/autopilot/ubuntu_system_settings/tests/test_sound.py 2014-07-09 00:25:18 +0000
@@ -1,9 +1,21 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2#
2# Copyright 2014 Canonical3# Copyright 2014 Canonical
3#4#
4# This program is free software: you can redistribute it and/or modify it5# This file is part of ubuntu-system-settings
5# under the terms of the GNU General Public License version 3, as published6#
6# by the Free Software Foundation.7# ubuntu-system-settings is free software: you can redistribute it and/or
8# modify it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; version 3.
10#
11# ubuntu-system-settings is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
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/>.
18
719
8from testtools.matchers import Equals, NotEquals20from testtools.matchers import Equals, NotEquals
921
@@ -30,5 +42,6 @@
30 kbd_snd = self.system_settings.main_view.sound_page.select_single(42 kbd_snd = self.system_settings.main_view.sound_page.select_single(
31 objectName="keyboardSoundSwitch")43 objectName="keyboardSoundSwitch")
32 current_value = kbd_snd.get_properties()["checked"]44 current_value = kbd_snd.get_properties()["checked"]
33 self.system_settings.main_view.pointer.click_object(kbd_snd)45 self.system_settings.main_view.pointing_device.click_object(kbd_snd)
34 self.assertThat(kbd_snd.get_properties()["checked"], NotEquals(current_value))46 self.assertThat(
47 kbd_snd.get_properties()["checked"], NotEquals(current_value))

Subscribers

People subscribed via source and target branches