Merge lp:~elopio/ubuntu-system-settings/my_less_flaky into lp:ubuntu-system-settings
- my_less_flaky
- Merge into trunk
Proposed by
Leo Arias
Status: | Superseded |
---|---|
Proposed branch: | lp:~elopio/ubuntu-system-settings/my_less_flaky |
Merge into: | lp:ubuntu-system-settings |
Diff against target: |
1516 lines (+321/-300) 13 files modified
tests/autopilot/ubuntu_system_settings/__init__.py (+41/-28) tests/autopilot/ubuntu_system_settings/tests/__init__.py (+54/-66) tests/autopilot/ubuntu_system_settings/tests/test_about.py (+10/-15) tests/autopilot/ubuntu_system_settings/tests/test_background.py (+5/-5) tests/autopilot/ubuntu_system_settings/tests/test_datetime.py (+19/-24) tests/autopilot/ubuntu_system_settings/tests/test_main.py (+4/-4) tests/autopilot/ubuntu_system_settings/tests/test_phone.py (+3/-20) tests/autopilot/ubuntu_system_settings/tests/test_phone_sound.py (+32/-0) tests/autopilot/ubuntu_system_settings/tests/test_plugins.py (+18/-18) tests/autopilot/ubuntu_system_settings/tests/test_search.py (+4/-4) tests/autopilot/ubuntu_system_settings/tests/test_security.py (+88/-67) tests/autopilot/ubuntu_system_settings/tests/test_sound.py (+36/-42) tests/autopilot/ubuntu_system_settings/tests/test_wifi.py (+7/-7) |
To merge this branch: | bzr merge lp:~elopio/ubuntu-system-settings/my_less_flaky |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Needs Fixing | |
Review via email: mp+245879@code.launchpad.net |
This proposal has been superseded by a proposal from 2015-01-08.
Commit message
Description of the change
Not yet ready, I'm proposing it to see the jenkins' results.
To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : | # |
review:
Needs Fixing
(continuous-integration)
Unmerged revisions
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'tests/autopilot/ubuntu_system_settings/__init__.py' | |||
2 | --- tests/autopilot/ubuntu_system_settings/__init__.py 2014-11-11 14:54:10 +0000 | |||
3 | +++ tests/autopilot/ubuntu_system_settings/__init__.py 2015-01-08 16:44:36 +0000 | |||
4 | @@ -119,6 +119,27 @@ | |||
5 | 119 | def go_to_cellular_page(self): | 119 | def go_to_cellular_page(self): |
6 | 120 | return self._go_to_page('entryComponent-cellular', 'cellularPage') | 120 | return self._go_to_page('entryComponent-cellular', 'cellularPage') |
7 | 121 | 121 | ||
8 | 122 | @autopilot.logging.log_action(logger.debug) | ||
9 | 123 | def go_to_phone_page(self): | ||
10 | 124 | return self._go_to_page('entryComponent-phone', 'phonePage') | ||
11 | 125 | |||
12 | 126 | @autopilot.logging.log_action(logger.debug) | ||
13 | 127 | def go_to_about_page(self): | ||
14 | 128 | return self._go_to_page('entryComponent-about', 'aboutPage') | ||
15 | 129 | |||
16 | 130 | @autopilot.logging.log_action(logger.debug) | ||
17 | 131 | def go_to_sound_page(self): | ||
18 | 132 | return self._go_to_page('entryComponent-sound', 'soundPage') | ||
19 | 133 | |||
20 | 134 | @autopilot.logging.log_action(logger.debug) | ||
21 | 135 | def go_to_security_page(self): | ||
22 | 136 | return self._go_to_page('entryComponent-security-privacy', | ||
23 | 137 | 'securityPrivacyPage') | ||
24 | 138 | |||
25 | 139 | @autopilot.logging.log_action(logger.debug) | ||
26 | 140 | def go_to_datetime_page(self): | ||
27 | 141 | return self._go_to_page('entryComponent-time-date', 'timeDatePage') | ||
28 | 142 | |||
29 | 122 | def _go_to_page(self, item_object_name, page_object_name): | 143 | def _go_to_page(self, item_object_name, page_object_name): |
30 | 123 | self.click_item(item_object_name) | 144 | self.click_item(item_object_name) |
31 | 124 | page = self.wait_select_single(objectName=page_object_name) | 145 | page = self.wait_select_single(objectName=page_object_name) |
32 | @@ -150,11 +171,6 @@ | |||
33 | 150 | return self.select_single(objectName='systemSettingsPage') | 171 | return self.select_single(objectName='systemSettingsPage') |
34 | 151 | 172 | ||
35 | 152 | @property | 173 | @property |
36 | 153 | def cellular_page(self): | ||
37 | 154 | """ Return 'Cellular' page """ | ||
38 | 155 | return self.select_single(objectName='cellularPage') | ||
39 | 156 | |||
40 | 157 | @property | ||
41 | 158 | def choose_page(self): | 174 | def choose_page(self): |
42 | 159 | """ Return 'Choose carrier' page """ | 175 | """ Return 'Choose carrier' page """ |
43 | 160 | return self.select_single(objectName="chooseCarrierPage") | 176 | return self.select_single(objectName="chooseCarrierPage") |
44 | @@ -175,26 +191,6 @@ | |||
45 | 175 | return self.select_single(objectName='backgroundPage') | 191 | return self.select_single(objectName='backgroundPage') |
46 | 176 | 192 | ||
47 | 177 | @property | 193 | @property |
48 | 178 | def sound_page(self): | ||
49 | 179 | """ Return 'Sound' page """ | ||
50 | 180 | return self.select_single(objectName='soundPage') | ||
51 | 181 | |||
52 | 182 | @property | ||
53 | 183 | def security_page(self): | ||
54 | 184 | """ Return 'Security' page """ | ||
55 | 185 | return self.select_single(objectName='securityPrivacyPage') | ||
56 | 186 | |||
57 | 187 | @property | ||
58 | 188 | def about_page(self): | ||
59 | 189 | """ Return 'About' page """ | ||
60 | 190 | return self.select_single(objectName='aboutPage') | ||
61 | 191 | |||
62 | 192 | @property | ||
63 | 193 | def wifi_page(self): | ||
64 | 194 | """ Return 'Wifi' page """ | ||
65 | 195 | return self.select_single(objectName='wifiPage') | ||
66 | 196 | |||
67 | 197 | @property | ||
68 | 198 | def _orientation_lock_switch(self): | 194 | def _orientation_lock_switch(self): |
69 | 199 | return self.wait_select_single( | 195 | return self.wait_select_single( |
70 | 200 | ubuntuuitoolkit.CheckBox, | 196 | ubuntuuitoolkit.CheckBox, |
71 | @@ -209,7 +205,7 @@ | |||
72 | 209 | 205 | ||
73 | 210 | class CellularPage(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase): | 206 | class CellularPage(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase): |
74 | 211 | 207 | ||
76 | 212 | """Autopilot helper for the Sound page.""" | 208 | """Autopilot helper for the Cellular page.""" |
77 | 213 | 209 | ||
78 | 214 | @classmethod | 210 | @classmethod |
79 | 215 | def validate_dbus_object(cls, path, state): | 211 | def validate_dbus_object(cls, path, state): |
80 | @@ -390,7 +386,7 @@ | |||
81 | 390 | 386 | ||
82 | 391 | class TimeAndDatePage(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase): | 387 | class TimeAndDatePage(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase): |
83 | 392 | 388 | ||
85 | 393 | """Autopilot helper for the Sound page.""" | 389 | """Autopilot helper for the TimeAndDate page.""" |
86 | 394 | 390 | ||
87 | 395 | @classmethod | 391 | @classmethod |
88 | 396 | def validate_dbus_object(cls, path, state): | 392 | def validate_dbus_object(cls, path, state): |
89 | @@ -421,7 +417,7 @@ | |||
90 | 421 | @classmethod | 417 | @classmethod |
91 | 422 | def validate_dbus_object(cls, path, state): | 418 | def validate_dbus_object(cls, path, state): |
92 | 423 | name = introspection.get_classname_from_path(path) | 419 | name = introspection.get_classname_from_path(path) |
94 | 424 | if name == b'ItemPage': | 420 | if name == b'PageComponent': |
95 | 425 | if state['objectName'][1] == 'aboutPage': | 421 | if state['objectName'][1] == 'aboutPage': |
96 | 426 | return True | 422 | return True |
97 | 427 | return False | 423 | return False |
98 | @@ -464,6 +460,7 @@ | |||
99 | 464 | def go_to_check_for_updates(self): | 460 | def go_to_check_for_updates(self): |
100 | 465 | check_for_updates_button = self.select_single( | 461 | check_for_updates_button = self.select_single( |
101 | 466 | objectName='updateButton') | 462 | objectName='updateButton') |
102 | 463 | check_for_updates_button.swipe_into_view() | ||
103 | 467 | self.pointing_device.click_object(check_for_updates_button) | 464 | self.pointing_device.click_object(check_for_updates_button) |
104 | 468 | system_updates_page = self.get_root_instance().wait_select_single( | 465 | system_updates_page = self.get_root_instance().wait_select_single( |
105 | 469 | objectName='systemUpdatesPage') | 466 | objectName='systemUpdatesPage') |
106 | @@ -481,6 +478,10 @@ | |||
107 | 481 | licenses_page.active.wait_for(True) | 478 | licenses_page.active.wait_for(True) |
108 | 482 | return licenses_page | 479 | return licenses_page |
109 | 483 | 480 | ||
110 | 481 | def get_number(self, obj): | ||
111 | 482 | number = self.select_single(objectName=obj) | ||
112 | 483 | return number.value | ||
113 | 484 | |||
114 | 484 | 485 | ||
115 | 485 | class LicensesPage(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase): | 486 | class LicensesPage(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase): |
116 | 486 | 487 | ||
117 | @@ -576,6 +577,18 @@ | |||
118 | 576 | 577 | ||
119 | 577 | return self._go_to_page(find, 'servicesPage') | 578 | return self._go_to_page(find, 'servicesPage') |
120 | 578 | 579 | ||
121 | 580 | @property | ||
122 | 581 | def _dialpad_sounds(self): | ||
123 | 582 | return self.wait_select_single( | ||
124 | 583 | ubuntuuitoolkit.CheckBox, | ||
125 | 584 | objectName='dialpadSounds') | ||
126 | 585 | |||
127 | 586 | def enable_dialpad_sounds(self): | ||
128 | 587 | self._dialpad_sounds.check() | ||
129 | 588 | |||
130 | 589 | def disable_dialpad_sounds(self): | ||
131 | 590 | self._dialpad_sounds.uncheck() | ||
132 | 591 | |||
133 | 579 | 592 | ||
134 | 580 | class CallWaiting(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase): | 593 | class CallWaiting(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase): |
135 | 581 | 594 | ||
136 | 582 | 595 | ||
137 | === modified file 'tests/autopilot/ubuntu_system_settings/tests/__init__.py' | |||
138 | --- tests/autopilot/ubuntu_system_settings/tests/__init__.py 2014-12-01 15:24:55 +0000 | |||
139 | +++ tests/autopilot/ubuntu_system_settings/tests/__init__.py 2015-01-08 16:44:36 +0000 | |||
140 | @@ -60,8 +60,9 @@ | |||
141 | 60 | def setUp(self, panel=None): | 60 | def setUp(self, panel=None): |
142 | 61 | super(UbuntuSystemSettingsTestCase, self).setUp() | 61 | super(UbuntuSystemSettingsTestCase, self).setUp() |
143 | 62 | self.system_settings = SystemSettings(self, panel=panel) | 62 | self.system_settings = SystemSettings(self, panel=panel) |
144 | 63 | self.main_view = self.system_settings.main_view | ||
145 | 63 | self.assertThat( | 64 | self.assertThat( |
147 | 64 | self.system_settings.main_view.visible, | 65 | self.main_view.visible, |
148 | 65 | Eventually(Equals(True))) | 66 | Eventually(Equals(True))) |
149 | 66 | 67 | ||
150 | 67 | def set_orientation(self, gsettings, value): | 68 | def set_orientation(self, gsettings, value): |
151 | @@ -109,10 +110,6 @@ | |||
152 | 109 | def setUp(self): | 110 | def setUp(self): |
153 | 110 | super(UbuntuSystemSettingsBatteryTestCase, self).setUp() | 111 | super(UbuntuSystemSettingsBatteryTestCase, self).setUp() |
154 | 111 | self.add_mock_battery() | 112 | self.add_mock_battery() |
155 | 112 | self.system_settings = SystemSettings(self) | ||
156 | 113 | self.assertThat( | ||
157 | 114 | self.system_settings.main_view.visible, | ||
158 | 115 | Eventually(Equals(True))) | ||
159 | 116 | 113 | ||
160 | 117 | 114 | ||
161 | 118 | class UbuntuSystemSettingsOfonoTestCase(UbuntuSystemSettingsTestCase, | 115 | class UbuntuSystemSettingsOfonoTestCase(UbuntuSystemSettingsTestCase, |
162 | @@ -124,14 +121,14 @@ | |||
163 | 124 | @property | 121 | @property |
164 | 125 | def choose_carrier_page(self): | 122 | def choose_carrier_page(self): |
165 | 126 | """Return carrier selection page""" | 123 | """Return carrier selection page""" |
167 | 127 | return self.system_settings.main_view.select_single( | 124 | return self.main_view.select_single( |
168 | 128 | objectName='chooseCarrierPage' | 125 | objectName='chooseCarrierPage' |
169 | 129 | ) | 126 | ) |
170 | 130 | 127 | ||
171 | 131 | @property | 128 | @property |
172 | 132 | def choose_carriers_page(self): | 129 | def choose_carriers_page(self): |
173 | 133 | """Return carriers selection page""" | 130 | """Return carriers selection page""" |
175 | 134 | return self.system_settings.main_view.select_single( | 131 | return self.main_view.select_single( |
176 | 135 | objectName='chooseCarriersPage' | 132 | objectName='chooseCarriersPage' |
177 | 136 | ) | 133 | ) |
178 | 137 | 134 | ||
179 | @@ -289,6 +286,12 @@ | |||
180 | 289 | template, stdout=subprocess.PIPE) | 286 | template, stdout=subprocess.PIPE) |
181 | 290 | cls.dbusmock = dbus.Interface(cls.obj_ofono, dbusmock.MOCK_IFACE) | 287 | cls.dbusmock = dbus.Interface(cls.obj_ofono, dbusmock.MOCK_IFACE) |
182 | 291 | 288 | ||
183 | 289 | @classmethod | ||
184 | 290 | def tearDownClass(cls): | ||
185 | 291 | super(UbuntuSystemSettingsOfonoTestCase, cls).tearDownClass() | ||
186 | 292 | cls.p_mock.terminate() | ||
187 | 293 | cls.p_mock.wait() | ||
188 | 294 | |||
189 | 292 | def setUp(self, panel=None): | 295 | def setUp(self, panel=None): |
190 | 293 | self.obj_ofono.Reset() | 296 | self.obj_ofono.Reset() |
191 | 294 | 297 | ||
192 | @@ -296,7 +299,7 @@ | |||
193 | 296 | if self.use_sims == 2: | 299 | if self.use_sims == 2: |
194 | 297 | self.add_sim2() | 300 | self.add_sim2() |
195 | 298 | 301 | ||
197 | 299 | super(UbuntuSystemSettingsOfonoTestCase, self).setUp(panel) | 302 | super(UbuntuSystemSettingsOfonoTestCase, self).setUp() |
198 | 300 | 303 | ||
199 | 301 | def set_default_for_calls(self, gsettings, default): | 304 | def set_default_for_calls(self, gsettings, default): |
200 | 302 | gsettings.set_value('default-sim-for-calls', default) | 305 | gsettings.set_value('default-sim-for-calls', default) |
201 | @@ -309,12 +312,12 @@ | |||
202 | 309 | sleep(1) | 312 | sleep(1) |
203 | 310 | 313 | ||
204 | 311 | def get_default_sim_for_calls_selector(self, text): | 314 | def get_default_sim_for_calls_selector(self, text): |
206 | 312 | return self.system_settings.main_view.cellular_page.select_single( | 315 | return self.cellular_page.select_single( |
207 | 313 | objectName="defaultForCalls" + text | 316 | objectName="defaultForCalls" + text |
208 | 314 | ) | 317 | ) |
209 | 315 | 318 | ||
210 | 316 | def get_default_sim_for_messages_selector(self, text): | 319 | def get_default_sim_for_messages_selector(self, text): |
212 | 317 | return self.system_settings.main_view.cellular_page.select_single( | 320 | return self.cellular_page.select_single( |
213 | 318 | objectName="defaultForMessages" + text | 321 | objectName="defaultForMessages" + text |
214 | 319 | ) | 322 | ) |
215 | 320 | 323 | ||
216 | @@ -324,35 +327,28 @@ | |||
217 | 324 | def setUp(self): | 327 | def setUp(self): |
218 | 325 | """ Go to Cellular page """ | 328 | """ Go to Cellular page """ |
219 | 326 | super(CellularBaseTestCase, self).setUp() | 329 | super(CellularBaseTestCase, self).setUp() |
222 | 327 | self.cellular_page = self.system_settings.\ | 330 | self.cellular_page = self.main_view.go_to_cellular_page() |
221 | 328 | main_view.go_to_cellular_page() | ||
223 | 329 | 331 | ||
224 | 330 | 332 | ||
225 | 331 | class PhoneOfonoBaseTestCase(UbuntuSystemSettingsOfonoTestCase): | 333 | class PhoneOfonoBaseTestCase(UbuntuSystemSettingsOfonoTestCase): |
226 | 332 | def setUp(self): | 334 | def setUp(self): |
227 | 333 | """ Go to Phone page """ | 335 | """ Go to Phone page """ |
232 | 334 | super(PhoneOfonoBaseTestCase, self).setUp('phone') | 336 | super(PhoneOfonoBaseTestCase, self).setUp() |
233 | 335 | self.phone_page = self.system_settings.main_view.select_single( | 337 | self.phone_page = self.main_view.go_to_phone_page() |
230 | 336 | objectName='phonePage' | ||
231 | 337 | ) | ||
234 | 338 | 338 | ||
235 | 339 | 339 | ||
236 | 340 | class AboutBaseTestCase(UbuntuSystemSettingsTestCase): | 340 | class AboutBaseTestCase(UbuntuSystemSettingsTestCase): |
237 | 341 | def setUp(self): | 341 | def setUp(self): |
238 | 342 | """Go to About page.""" | 342 | """Go to About page.""" |
243 | 343 | super(AboutBaseTestCase, self).setUp('about') | 343 | super(AboutBaseTestCase, self).setUp() |
244 | 344 | self.about_page = self.system_settings.main_view.select_single( | 344 | self.about_page = self.main_view.go_to_about_page() |
241 | 345 | objectName='aboutPage' | ||
242 | 346 | ) | ||
245 | 347 | 345 | ||
246 | 348 | 346 | ||
247 | 349 | class AboutOfonoBaseTestCase(UbuntuSystemSettingsOfonoTestCase): | 347 | class AboutOfonoBaseTestCase(UbuntuSystemSettingsOfonoTestCase): |
248 | 350 | def setUp(self): | 348 | def setUp(self): |
249 | 351 | """Go to About page.""" | 349 | """Go to About page.""" |
254 | 352 | super(AboutOfonoBaseTestCase, self).setUp('about') | 350 | super(AboutOfonoBaseTestCase, self).setUp() |
255 | 353 | self.about_page = self.system_settings.main_view.select_single( | 351 | self.about_page = self.main_view.go_to_about_page() |
252 | 354 | objectName='aboutPage' | ||
253 | 355 | ) | ||
256 | 356 | 352 | ||
257 | 357 | 353 | ||
258 | 358 | class AboutSystemImageBaseTestCase(AboutBaseTestCase, | 354 | class AboutSystemImageBaseTestCase(AboutBaseTestCase, |
259 | @@ -396,12 +392,15 @@ | |||
260 | 396 | def setUp(self): | 392 | def setUp(self): |
261 | 397 | """Go to Storage Page.""" | 393 | """Go to Storage Page.""" |
262 | 398 | super(StorageBaseTestCase, self).setUp() | 394 | super(StorageBaseTestCase, self).setUp() |
264 | 399 | self.system_settings.main_view.click_item('storageItem') | 395 | self.main_view.click_item('storageItem') |
265 | 396 | self.storage_page = self.main_view.select_single( | ||
266 | 397 | 'Storage', objectName='storagePage' | ||
267 | 398 | ) | ||
268 | 400 | self.assertThat(self.storage_page.active, Eventually(Equals(True))) | 399 | self.assertThat(self.storage_page.active, Eventually(Equals(True))) |
269 | 401 | 400 | ||
270 | 402 | def assert_space_item(self, object_name, text): | 401 | def assert_space_item(self, object_name, text): |
271 | 403 | """ Checks whether an space item exists and returns a value """ | 402 | """ Checks whether an space item exists and returns a value """ |
273 | 404 | item = self.system_settings.main_view.storage_page.select_single( | 403 | item = self.main_view.storage_page.select_single( |
274 | 405 | objectName=object_name | 404 | objectName=object_name |
275 | 406 | ) | 405 | ) |
276 | 407 | self.assertThat(item, NotEquals(None)) | 406 | self.assertThat(item, NotEquals(None)) |
277 | @@ -417,13 +416,6 @@ | |||
278 | 417 | return self.main_view.wait_select_single( | 416 | return self.main_view.wait_select_single( |
279 | 418 | 'StorageItem', objectName=objectName).value | 417 | 'StorageItem', objectName=objectName).value |
280 | 419 | 418 | ||
281 | 420 | @property | ||
282 | 421 | def storage_page(self): | ||
283 | 422 | """ Return 'Storage' page """ | ||
284 | 423 | return self.system_settings.main_view.select_single( | ||
285 | 424 | 'Storage', objectName='storagePage' | ||
286 | 425 | ) | ||
287 | 426 | |||
288 | 427 | 419 | ||
289 | 428 | class LicenseBaseTestCase(AboutBaseTestCase): | 420 | class LicenseBaseTestCase(AboutBaseTestCase): |
290 | 429 | 421 | ||
291 | @@ -442,8 +434,7 @@ | |||
292 | 442 | def setUp(self): | 434 | def setUp(self): |
293 | 443 | """Go to SystemUpdates Page.""" | 435 | """Go to SystemUpdates Page.""" |
294 | 444 | super(SystemUpdatesBaseTestCase, self).setUp() | 436 | super(SystemUpdatesBaseTestCase, self).setUp() |
297 | 445 | self.system_settings.main_view.click_item( | 437 | self.main_view.click_item('entryComponent-system-update') |
296 | 446 | 'entryComponent-system-update') | ||
298 | 447 | 438 | ||
299 | 448 | 439 | ||
300 | 449 | class BackgroundBaseTestCase( | 440 | class BackgroundBaseTestCase( |
301 | @@ -515,7 +506,7 @@ | |||
302 | 515 | 'SYSTEM_SETTINGS_UBUNTU_ART_DIR', art_dir)) | 506 | 'SYSTEM_SETTINGS_UBUNTU_ART_DIR', art_dir)) |
303 | 516 | 507 | ||
304 | 517 | super(BackgroundBaseTestCase, self).setUp('background') | 508 | super(BackgroundBaseTestCase, self).setUp('background') |
306 | 518 | self.assertThat(self.system_settings.main_view.background_page.active, | 509 | self.assertThat(self.main_view.background_page.active, |
307 | 519 | Eventually(Equals(True))) | 510 | Eventually(Equals(True))) |
308 | 520 | 511 | ||
309 | 521 | def tearDown(self): | 512 | def tearDown(self): |
310 | @@ -532,11 +523,14 @@ | |||
311 | 532 | @classmethod | 523 | @classmethod |
312 | 533 | def setUpClass(klass): | 524 | def setUpClass(klass): |
313 | 534 | klass.start_system_bus() | 525 | klass.start_system_bus() |
314 | 535 | klass.start_session_bus() | ||
315 | 536 | klass.dbus_con = klass.get_dbus(True) | 526 | klass.dbus_con = klass.get_dbus(True) |
316 | 537 | klass.dbus_con_session = klass.get_dbus(False) | 527 | klass.dbus_con_session = klass.get_dbus(False) |
317 | 538 | 528 | ||
318 | 539 | def setUp(self, panel='sound'): | 529 | def setUp(self, panel='sound'): |
319 | 530 | # TODO only do this if the sound indicator is running. | ||
320 | 531 | # --elopio - 2015-01-08 | ||
321 | 532 | self.stop_sound_indicator() | ||
322 | 533 | self.addCleanup(self.start_sound_indicator) | ||
323 | 540 | 534 | ||
324 | 541 | user_obj = '/user/foo' | 535 | user_obj = '/user/foo' |
325 | 542 | 536 | ||
326 | @@ -562,7 +556,9 @@ | |||
327 | 562 | GTK_ACTIONS_IFACE, | 556 | GTK_ACTIONS_IFACE, |
328 | 563 | stdout=subprocess.PIPE) | 557 | stdout=subprocess.PIPE) |
329 | 564 | 558 | ||
331 | 565 | sleep(2) | 559 | self.wait_for_bus_object(ACCOUNTS_IFACE, |
332 | 560 | ACCOUNTS_OBJ, | ||
333 | 561 | system_bus=True) | ||
334 | 566 | 562 | ||
335 | 567 | self.dbus_mock = dbus.Interface(self.dbus_con.get_object( | 563 | self.dbus_mock = dbus.Interface(self.dbus_con.get_object( |
336 | 568 | ACCOUNTS_IFACE, | 564 | ACCOUNTS_IFACE, |
337 | @@ -570,6 +566,9 @@ | |||
338 | 570 | ACCOUNTS_IFACE), | 566 | ACCOUNTS_IFACE), |
339 | 571 | dbusmock.MOCK_IFACE) | 567 | dbusmock.MOCK_IFACE) |
340 | 572 | 568 | ||
341 | 569 | self.wait_for_bus_object(ISOUND_SERVICE, | ||
342 | 570 | ISOUND_ACTION_PATH) | ||
343 | 571 | |||
344 | 573 | self.dbus_mock_isound = dbus.Interface( | 572 | self.dbus_mock_isound = dbus.Interface( |
345 | 574 | self.dbus_con_session.get_object( | 573 | self.dbus_con_session.get_object( |
346 | 575 | ISOUND_SERVICE, | 574 | ISOUND_SERVICE, |
347 | @@ -626,8 +625,8 @@ | |||
348 | 626 | ACCOUNTS_SOUND_IFACE) | 625 | ACCOUNTS_SOUND_IFACE) |
349 | 627 | ]) | 626 | ]) |
350 | 628 | 627 | ||
353 | 629 | self.obj_test = self.dbus_con.get_object(ACCOUNTS_IFACE, user_obj, | 628 | self.obj_snd = self.dbus_con.get_object(ACCOUNTS_IFACE, user_obj, |
354 | 630 | ACCOUNTS_IFACE) | 629 | ACCOUNTS_IFACE) |
355 | 631 | 630 | ||
356 | 632 | self.dbus_mock_isound.AddMethods( | 631 | self.dbus_mock_isound.AddMethods( |
357 | 633 | GTK_ACTIONS_IFACE, | 632 | GTK_ACTIONS_IFACE, |
358 | @@ -661,9 +660,11 @@ | |||
359 | 661 | 660 | ||
360 | 662 | super(SoundBaseTestCase, self).setUp(panel) | 661 | super(SoundBaseTestCase, self).setUp(panel) |
361 | 663 | 662 | ||
362 | 664 | """ Go to Sound page """ | ||
363 | 665 | if panel == 'sound': | 663 | if panel == 'sound': |
365 | 666 | self.assertThat(self.system_settings.main_view.sound_page.active, | 664 | self.sound_page = self.main_view.select_single( |
366 | 665 | objectName='soundPage' | ||
367 | 666 | ) | ||
368 | 667 | self.assertThat(self.sound_page.active, | ||
369 | 667 | Eventually(Equals(True))) | 668 | Eventually(Equals(True))) |
370 | 668 | 669 | ||
371 | 669 | def tearDown(self): | 670 | def tearDown(self): |
372 | @@ -673,6 +674,12 @@ | |||
373 | 673 | self.mock_isound.wait() | 674 | self.mock_isound.wait() |
374 | 674 | super(SoundBaseTestCase, self).tearDown() | 675 | super(SoundBaseTestCase, self).tearDown() |
375 | 675 | 676 | ||
376 | 677 | def start_sound_indicator(self): | ||
377 | 678 | subprocess.call(['initctl', 'start', 'indicator-sound']) | ||
378 | 679 | |||
379 | 680 | def stop_sound_indicator(self): | ||
380 | 681 | subprocess.call(['initctl', 'stop', 'indicator-sound']) | ||
381 | 682 | |||
382 | 676 | 683 | ||
383 | 677 | class ResetBaseTestCase(UbuntuSystemSettingsTestCase, | 684 | class ResetBaseTestCase(UbuntuSystemSettingsTestCase, |
384 | 678 | dbusmock.DBusTestCase): | 685 | dbusmock.DBusTestCase): |
385 | @@ -698,7 +705,7 @@ | |||
386 | 698 | def setUp(self): | 705 | def setUp(self): |
387 | 699 | self.mock_for_factory_reset() | 706 | self.mock_for_factory_reset() |
388 | 700 | super(ResetBaseTestCase, self).setUp() | 707 | super(ResetBaseTestCase, self).setUp() |
390 | 701 | self.reset_page = self.system_settings.main_view.go_to_reset_phone() | 708 | self.reset_page = self.main_view.go_to_reset_phone() |
391 | 702 | 709 | ||
392 | 703 | def tearDown(self): | 710 | def tearDown(self): |
393 | 704 | self.mock_server.terminate() | 711 | self.mock_server.terminate() |
394 | @@ -710,30 +717,13 @@ | |||
395 | 710 | """ Base class for security and privacy settings tests""" | 717 | """ Base class for security and privacy settings tests""" |
396 | 711 | 718 | ||
397 | 712 | def setUp(self): | 719 | def setUp(self): |
405 | 713 | super(SecurityBaseTestCase, self).setUp('security-privacy') | 720 | super(SecurityBaseTestCase, self).setUp() |
406 | 714 | """ Go to Security & Privacy page """ | 721 | self.security_page = self.main_view.go_to_security_page() |
400 | 715 | self.security_page = self.system_settings.main_view.select_single( | ||
401 | 716 | objectName='securityPrivacyPage' | ||
402 | 717 | ) | ||
403 | 718 | self.assertThat(self.security_page.active, | ||
404 | 719 | Eventually(Equals(True))) | ||
407 | 720 | 722 | ||
408 | 721 | def tearDown(self): | 723 | def tearDown(self): |
409 | 722 | super(SecurityBaseTestCase, self).tearDown() | 724 | super(SecurityBaseTestCase, self).tearDown() |
410 | 723 | 725 | ||
411 | 724 | 726 | ||
412 | 725 | class PhoneSoundBaseTestCase(SoundBaseTestCase): | ||
413 | 726 | def setUp(self): | ||
414 | 727 | """ Go to Phone page """ | ||
415 | 728 | super(PhoneSoundBaseTestCase, self).setUp('phone') | ||
416 | 729 | self.phone_page = self.system_settings.main_view.select_single( | ||
417 | 730 | objectName='phonePage' | ||
418 | 731 | ) | ||
419 | 732 | |||
420 | 733 | def tearDown(self): | ||
421 | 734 | super(PhoneSoundBaseTestCase, self).tearDown() | ||
422 | 735 | |||
423 | 736 | |||
424 | 737 | class LanguageBaseTestCase(UbuntuSystemSettingsTestCase, | 727 | class LanguageBaseTestCase(UbuntuSystemSettingsTestCase, |
425 | 738 | dbusmock.DBusTestCase): | 728 | dbusmock.DBusTestCase): |
426 | 739 | """ Base class for language settings tests""" | 729 | """ Base class for language settings tests""" |
427 | @@ -759,8 +749,7 @@ | |||
428 | 759 | self.mock_loginmanager() | 749 | self.mock_loginmanager() |
429 | 760 | 750 | ||
430 | 761 | super(LanguageBaseTestCase, self).setUp() | 751 | super(LanguageBaseTestCase, self).setUp() |
433 | 762 | self.language_page = self.system_settings.\ | 752 | self.language_page = self.main_view.go_to_language_page() |
432 | 763 | main_view.go_to_language_page() | ||
434 | 764 | 753 | ||
435 | 765 | def tearDown(self): | 754 | def tearDown(self): |
436 | 766 | self.mock_server.terminate() | 755 | self.mock_server.terminate() |
437 | @@ -799,8 +788,7 @@ | |||
438 | 799 | pass | 788 | pass |
439 | 800 | 789 | ||
440 | 801 | super(WifiBaseTestCase, self).setUp() | 790 | super(WifiBaseTestCase, self).setUp() |
443 | 802 | self.wifi_page = self.system_settings.\ | 791 | self.wifi_page = self.main_view.go_to_wifi_page() |
442 | 803 | main_view.go_to_wifi_page() | ||
444 | 804 | 792 | ||
445 | 805 | def add_previous_networks(self, networks): | 793 | def add_previous_networks(self, networks): |
446 | 806 | dev_path = str(self.obj_nm.GetDevices()[0]) | 794 | dev_path = str(self.obj_nm.GetDevices()[0]) |
447 | 807 | 795 | ||
448 | === modified file 'tests/autopilot/ubuntu_system_settings/tests/test_about.py' | |||
449 | --- tests/autopilot/ubuntu_system_settings/tests/test_about.py 2014-11-19 12:03:35 +0000 | |||
450 | +++ tests/autopilot/ubuntu_system_settings/tests/test_about.py 2015-01-08 16:44:36 +0000 | |||
451 | @@ -133,10 +133,8 @@ | |||
452 | 133 | self.assertThat(displayed_imei, Equals(device_imei)) | 133 | self.assertThat(displayed_imei, Equals(device_imei)) |
453 | 134 | 134 | ||
454 | 135 | def test_phone_number(self): | 135 | def test_phone_number(self): |
459 | 136 | number = self.system_settings.main_view.about_page.select_single( | 136 | self.assertEqual(str(self.about_page.get_number('numberItem')), |
460 | 137 | objectName="numberItem" | 137 | '123456789') |
457 | 138 | ) | ||
458 | 139 | self.assertEqual(str(number.value), "123456789") | ||
461 | 140 | 138 | ||
462 | 141 | 139 | ||
463 | 142 | class AboutOfonoMultiSimTestCase(AboutOfonoBaseTestCase): | 140 | class AboutOfonoMultiSimTestCase(AboutOfonoBaseTestCase): |
464 | @@ -144,14 +142,10 @@ | |||
465 | 144 | use_sims = 2 | 142 | use_sims = 2 |
466 | 145 | 143 | ||
467 | 146 | def test_phone_numbers(self): | 144 | def test_phone_numbers(self): |
476 | 147 | number1 = self.system_settings.main_view.about_page.select_single( | 145 | self.assertEqual(str(self.about_page.get_number('numberItem1')), |
477 | 148 | objectName="numberItem1" | 146 | '123456789') |
478 | 149 | ) | 147 | self.assertEqual(str(self.about_page.get_number('numberItem2')), |
479 | 150 | number2 = self.system_settings.main_view.about_page.select_single( | 148 | '08123') |
472 | 151 | objectName="numberItem2" | ||
473 | 152 | ) | ||
474 | 153 | self.assertEqual(str(number1.value), "123456789") | ||
475 | 154 | self.assertEqual(str(number2.value), "08123") | ||
480 | 155 | 149 | ||
481 | 156 | 150 | ||
482 | 157 | class AboutSystemImageTestCase(AboutSystemImageBaseTestCase): | 151 | class AboutSystemImageTestCase(AboutSystemImageBaseTestCase): |
483 | @@ -219,7 +213,7 @@ | |||
484 | 219 | 213 | ||
485 | 220 | def test_disk(self): | 214 | def test_disk(self): |
486 | 221 | """ Checks whether disk item is available """ | 215 | """ Checks whether disk item is available """ |
488 | 222 | disk_item = self.system_settings.main_view.storage_page.select_single( | 216 | disk_item = self.storage_page.select_single( |
489 | 223 | objectName='diskItem' | 217 | objectName='diskItem' |
490 | 224 | ) | 218 | ) |
491 | 225 | self.assertThat(disk_item.text, Equals('Total storage')) | 219 | self.assertThat(disk_item.text, Equals('Total storage')) |
492 | @@ -286,8 +280,9 @@ | |||
493 | 286 | 280 | ||
494 | 287 | def test_installed_apps(self): | 281 | def test_installed_apps(self): |
495 | 288 | """ Checks whether Installed Apps list is available """ | 282 | """ Checks whether Installed Apps list is available """ |
498 | 289 | installed_apps_list_view = self.system_settings.main_view.\ | 283 | installed_apps_list_view = self.storage_page.select_single( |
499 | 290 | storage_page.select_single(objectName='installedAppsListView') | 284 | objectName='installedAppsListView' |
500 | 285 | ) | ||
501 | 291 | self.assertThat(installed_apps_list_view, NotEquals(None)) | 286 | self.assertThat(installed_apps_list_view, NotEquals(None)) |
502 | 292 | 287 | ||
503 | 293 | 288 | ||
504 | 294 | 289 | ||
505 | === modified file 'tests/autopilot/ubuntu_system_settings/tests/test_background.py' | |||
506 | --- tests/autopilot/ubuntu_system_settings/tests/test_background.py 2014-07-22 21:44:35 +0000 | |||
507 | +++ tests/autopilot/ubuntu_system_settings/tests/test_background.py 2015-01-08 16:44:36 +0000 | |||
508 | @@ -24,7 +24,7 @@ | |||
509 | 24 | 24 | ||
510 | 25 | def setUp(self): | 25 | def setUp(self): |
511 | 26 | super(BackgroundTestCase, self).setUp() | 26 | super(BackgroundTestCase, self).setUp() |
513 | 27 | self.background_page = self.system_settings.main_view.background_page | 27 | self.background_page = self.main_view.background_page |
514 | 28 | 28 | ||
515 | 29 | def get_wallpapergrid(self, name): | 29 | def get_wallpapergrid(self, name): |
516 | 30 | """Return a WallpaperGrid with given name, or | 30 | """Return a WallpaperGrid with given name, or |
517 | @@ -64,9 +64,9 @@ | |||
518 | 64 | 64 | ||
519 | 65 | def save_wallpaper(self): | 65 | def save_wallpaper(self): |
520 | 66 | """Click on Set/Save button when previewing a wallpaper""" | 66 | """Click on Set/Save button when previewing a wallpaper""" |
522 | 67 | save = self.system_settings.main_view.wait_select_single( | 67 | save = self.main_view.wait_select_single( |
523 | 68 | objectName='saveButton') | 68 | objectName='saveButton') |
525 | 69 | self.system_settings.main_view.scroll_to_and_click(save) | 69 | self.main_view.scroll_to_and_click(save) |
526 | 70 | 70 | ||
527 | 71 | def test_background_page_title_is_correct(self): | 71 | def test_background_page_title_is_correct(self): |
528 | 72 | """ Checks whether Background page is available """ | 72 | """ Checks whether Background page is available """ |
529 | @@ -79,7 +79,7 @@ | |||
530 | 79 | old = self.selected_wallpaper.source | 79 | old = self.selected_wallpaper.source |
531 | 80 | 80 | ||
532 | 81 | # click a wallpaper that is not selected | 81 | # click a wallpaper that is not selected |
534 | 82 | self.system_settings.main_view.scroll_to_and_click( | 82 | self.main_view.scroll_to_and_click( |
535 | 83 | self.all_wallpapers[3]) | 83 | self.all_wallpapers[3]) |
536 | 84 | 84 | ||
537 | 85 | # click set/save | 85 | # click set/save |
538 | @@ -112,5 +112,5 @@ | |||
539 | 112 | objectName='CustomHeader') | 112 | objectName='CustomHeader') |
540 | 113 | 113 | ||
541 | 114 | self.assertEqual(custom.state, 'collapsed') | 114 | self.assertEqual(custom.state, 'collapsed') |
543 | 115 | self.system_settings.main_view.scroll_to_and_click(custom_header) | 115 | self.main_view.scroll_to_and_click(custom_header) |
544 | 116 | self.assertEqual(custom.state, '') | 116 | self.assertEqual(custom.state, '') |
545 | 117 | 117 | ||
546 | === modified file 'tests/autopilot/ubuntu_system_settings/tests/test_datetime.py' | |||
547 | --- tests/autopilot/ubuntu_system_settings/tests/test_datetime.py 2014-11-25 20:19:27 +0000 | |||
548 | +++ tests/autopilot/ubuntu_system_settings/tests/test_datetime.py 2015-01-08 16:44:36 +0000 | |||
549 | @@ -39,17 +39,12 @@ | |||
550 | 39 | def setUp(self): | 39 | def setUp(self): |
551 | 40 | """ Go to Time & Date page """ | 40 | """ Go to Time & Date page """ |
552 | 41 | self.obj_timedate1.Reset() | 41 | self.obj_timedate1.Reset() |
560 | 42 | super(TimeDateTestCase, self).setUp("time-date") | 42 | super(TimeDateTestCase, self).setUp() |
561 | 43 | 43 | self.page = self.main_view.go_to_datetime_page() | |
555 | 44 | @property | ||
556 | 45 | def time_date_page(self): | ||
557 | 46 | return self.system_settings.main_view.select_single( | ||
558 | 47 | objectName='timeDatePage' | ||
559 | 48 | ) | ||
562 | 49 | 44 | ||
563 | 50 | @property | 45 | @property |
564 | 51 | def tz_page(self): | 46 | def tz_page(self): |
566 | 52 | return self.system_settings.main_view.select_single( | 47 | return self.main_view.select_single( |
567 | 53 | objectName='timeZone' | 48 | objectName='timeZone' |
568 | 54 | ) | 49 | ) |
569 | 55 | 50 | ||
570 | @@ -67,22 +62,22 @@ | |||
571 | 67 | raise e | 62 | raise e |
572 | 68 | 63 | ||
573 | 69 | def click_tz_search_field(self): | 64 | def click_tz_search_field(self): |
576 | 70 | self.system_settings.main_view.scroll_to_and_click(self.tz_page) | 65 | self.main_view.scroll_to_and_click(self.tz_page) |
577 | 71 | text_field = self.system_settings.main_view.wait_select_single( | 66 | text_field = self.main_view.wait_select_single( |
578 | 72 | objectName='selectTimeZoneField' | 67 | objectName='selectTimeZoneField' |
579 | 73 | ) | 68 | ) |
581 | 74 | self.system_settings.main_view.pointing_device.move_to_object( | 69 | self.main_view.pointing_device.move_to_object( |
582 | 75 | text_field) | 70 | text_field) |
583 | 76 | 71 | ||
584 | 77 | def test_time_date_page(self): | 72 | def test_time_date_page(self): |
585 | 78 | """ Checks whether Time & Date page is available """ | 73 | """ Checks whether Time & Date page is available """ |
588 | 79 | self.assertThat(self.time_date_page, NotEquals(None)) | 74 | self.assertThat(self.page, NotEquals(None)) |
589 | 80 | self.assertThat(self.time_date_page.title, Equals(_('Time & Date'))) | 75 | self.assertThat(self.page.title, Equals(_('Time & Date'))) |
590 | 81 | 76 | ||
591 | 82 | def test_tz_list_initially_empty(self): | 77 | def test_tz_list_initially_empty(self): |
592 | 83 | """ Checks that no list is displayed initially """ | 78 | """ Checks that no list is displayed initially """ |
595 | 84 | self.system_settings.main_view.scroll_to_and_click(self.tz_page) | 79 | self.main_view.scroll_to_and_click(self.tz_page) |
596 | 85 | labelVisible = self.system_settings.main_view.wait_select_single( | 80 | labelVisible = self.main_view.wait_select_single( |
597 | 86 | objectName='nothingLabel').visible | 81 | objectName='nothingLabel').visible |
598 | 87 | self.assertThat(labelVisible, Equals(True)) | 82 | self.assertThat(labelVisible, Equals(True)) |
599 | 88 | 83 | ||
600 | @@ -90,7 +85,7 @@ | |||
601 | 90 | """ Check that searching for a valid location shows something """ | 85 | """ Check that searching for a valid location shows something """ |
602 | 91 | self.click_tz_search_field() | 86 | self.click_tz_search_field() |
603 | 92 | self.keyboard.type('London, United Kingdom') | 87 | self.keyboard.type('London, United Kingdom') |
605 | 93 | listview = self.system_settings.main_view.select_single( | 88 | listview = self.main_view.select_single( |
606 | 94 | objectName='locationsListView' | 89 | objectName='locationsListView' |
607 | 95 | ) | 90 | ) |
608 | 96 | self.assertThat(listview.count, Eventually(GreaterThan(0))) | 91 | self.assertThat(listview.count, Eventually(GreaterThan(0))) |
609 | @@ -99,11 +94,11 @@ | |||
610 | 99 | """ Check that searching for an invalid location shows nothing """ | 94 | """ Check that searching for an invalid location shows nothing """ |
611 | 100 | self.click_tz_search_field() | 95 | self.click_tz_search_field() |
612 | 101 | self.keyboard.type('Oh no you don\'t!') | 96 | self.keyboard.type('Oh no you don\'t!') |
614 | 102 | listview = self.system_settings.main_view.select_single( | 97 | listview = self.main_view.select_single( |
615 | 103 | objectName='locationsListView' | 98 | objectName='locationsListView' |
616 | 104 | ) | 99 | ) |
617 | 105 | self.assertThat(listview.count, Equals(0)) | 100 | self.assertThat(listview.count, Equals(0)) |
619 | 106 | labelVisible = self.system_settings.main_view.select_single( | 101 | labelVisible = self.main_view.select_single( |
620 | 107 | objectName='nothingLabel').visible | 102 | objectName='nothingLabel').visible |
621 | 108 | self.assertThat(labelVisible, Equals(True)) | 103 | self.assertThat(labelVisible, Equals(True)) |
622 | 109 | 104 | ||
623 | @@ -111,12 +106,12 @@ | |||
624 | 111 | """ Check that manually selecting a timezone sets it properly """ | 106 | """ Check that manually selecting a timezone sets it properly """ |
625 | 112 | self.click_tz_search_field() | 107 | self.click_tz_search_field() |
626 | 113 | self.keyboard.type('London, United Kingdom') | 108 | self.keyboard.type('London, United Kingdom') |
628 | 114 | listview = self.system_settings.main_view.select_single( | 109 | listview = self.main_view.select_single( |
629 | 115 | objectName='locationsListView' | 110 | objectName='locationsListView' |
630 | 116 | ) | 111 | ) |
631 | 117 | london = TimeDateTestCase.wait_select_listview_first(listview) | 112 | london = TimeDateTestCase.wait_select_listview_first(listview) |
634 | 118 | self.system_settings.main_view.pointing_device.click_object(london) | 113 | self.main_view.pointing_device.click_object(london) |
635 | 119 | header = self.system_settings.main_view.select_single( | 114 | header = self.main_view.select_single( |
636 | 120 | objectName='MainView_Header' | 115 | objectName='MainView_Header' |
637 | 121 | ) | 116 | ) |
638 | 122 | self.assertThat(header.title, Eventually(Equals(_('Time & Date')))) | 117 | self.assertThat(header.title, Eventually(Equals(_('Time & Date')))) |
639 | @@ -130,16 +125,16 @@ | |||
640 | 130 | self.click_tz_search_field() | 125 | self.click_tz_search_field() |
641 | 131 | # This is also in Europe/London | 126 | # This is also in Europe/London |
642 | 132 | self.keyboard.type('Preston, United Kingdom') | 127 | self.keyboard.type('Preston, United Kingdom') |
644 | 133 | listview = self.system_settings.main_view.select_single( | 128 | listview = self.main_view.select_single( |
645 | 134 | objectName='locationsListView' | 129 | objectName='locationsListView' |
646 | 135 | ) | 130 | ) |
647 | 136 | 131 | ||
648 | 137 | preston = TimeDateTestCase.wait_select_listview_first(listview) | 132 | preston = TimeDateTestCase.wait_select_listview_first(listview) |
650 | 138 | self.system_settings.main_view.pointing_device.click_object(preston) | 133 | self.main_view.pointing_device.click_object(preston) |
651 | 139 | 134 | ||
652 | 140 | # The timer is 1 second, wait and see that we haven't moved pages | 135 | # The timer is 1 second, wait and see that we haven't moved pages |
653 | 141 | sleep(2) | 136 | sleep(2) |
655 | 142 | header = self.system_settings.main_view.select_single( | 137 | header = self.main_view.select_single( |
656 | 143 | objectName='MainView_Header' | 138 | objectName='MainView_Header' |
657 | 144 | ) | 139 | ) |
658 | 145 | self.assertThat(header.title, Eventually(Equals(_('Time zone')))) | 140 | self.assertThat(header.title, Eventually(Equals(_('Time zone')))) |
659 | 146 | 141 | ||
660 | === modified file 'tests/autopilot/ubuntu_system_settings/tests/test_main.py' | |||
661 | --- tests/autopilot/ubuntu_system_settings/tests/test_main.py 2014-08-25 12:33:13 +0000 | |||
662 | +++ tests/autopilot/ubuntu_system_settings/tests/test_main.py 2015-01-08 16:44:36 +0000 | |||
663 | @@ -26,8 +26,8 @@ | |||
664 | 26 | self.addCleanup( | 26 | self.addCleanup( |
665 | 27 | self.set_orientation, gsettings, GLib.Variant('b', current)) | 27 | self.set_orientation, gsettings, GLib.Variant('b', current)) |
666 | 28 | 28 | ||
669 | 29 | self.system_settings.main_view.disable_orientation_lock() | 29 | self.main_view.disable_orientation_lock() |
670 | 30 | self.system_settings.main_view.enable_orientation_lock() | 30 | self.main_view.enable_orientation_lock() |
671 | 31 | 31 | ||
672 | 32 | self.assertThat( | 32 | self.assertThat( |
673 | 33 | lambda: gsettings.get_value('rotation-lock').get_boolean(), | 33 | lambda: gsettings.get_value('rotation-lock').get_boolean(), |
674 | @@ -40,8 +40,8 @@ | |||
675 | 40 | self.addCleanup( | 40 | self.addCleanup( |
676 | 41 | self.set_orientation, gsettings, GLib.Variant('b', current)) | 41 | self.set_orientation, gsettings, GLib.Variant('b', current)) |
677 | 42 | 42 | ||
680 | 43 | self.system_settings.main_view.enable_orientation_lock() | 43 | self.main_view.enable_orientation_lock() |
681 | 44 | self.system_settings.main_view.disable_orientation_lock() | 44 | self.main_view.disable_orientation_lock() |
682 | 45 | 45 | ||
683 | 46 | self.assertThat( | 46 | self.assertThat( |
684 | 47 | lambda: gsettings.get_value('rotation-lock').get_boolean(), | 47 | lambda: gsettings.get_value('rotation-lock').get_boolean(), |
685 | 48 | 48 | ||
686 | === modified file 'tests/autopilot/ubuntu_system_settings/tests/test_phone.py' | |||
687 | --- tests/autopilot/ubuntu_system_settings/tests/test_phone.py 2014-08-28 17:33:40 +0000 | |||
688 | +++ tests/autopilot/ubuntu_system_settings/tests/test_phone.py 2015-01-08 16:44:36 +0000 | |||
689 | @@ -8,22 +8,20 @@ | |||
690 | 8 | from __future__ import absolute_import | 8 | from __future__ import absolute_import |
691 | 9 | 9 | ||
692 | 10 | from autopilot.matchers import Eventually | 10 | from autopilot.matchers import Eventually |
694 | 11 | from testtools.matchers import Contains, Equals, NotEquals | 11 | from testtools.matchers import Contains, Equals |
695 | 12 | 12 | ||
696 | 13 | from ubuntu_system_settings.tests import ( | 13 | from ubuntu_system_settings.tests import ( |
697 | 14 | PhoneOfonoBaseTestCase, | 14 | PhoneOfonoBaseTestCase, |
698 | 15 | PhoneSoundBaseTestCase, | ||
699 | 16 | CALL_FWD_IFACE, | 15 | CALL_FWD_IFACE, |
700 | 17 | CALL_SETTINGS_IFACE | 16 | CALL_SETTINGS_IFACE |
701 | 18 | ) | 17 | ) |
702 | 19 | 18 | ||
703 | 20 | 19 | ||
704 | 21 | class PhoneTestCase(PhoneOfonoBaseTestCase): | 20 | class PhoneTestCase(PhoneOfonoBaseTestCase): |
705 | 22 | """Tests for Phone Page""" | ||
706 | 23 | 21 | ||
707 | 24 | def test_call_fwd(self): | 22 | def test_call_fwd(self): |
708 | 25 | call_fwd_page = self.phone_page.go_to_call_forwarding() | 23 | call_fwd_page = self.phone_page.go_to_call_forwarding() |
710 | 26 | call_fwd_page.set_forward("41444424") | 24 | call_fwd_page.set_forward('41444424') |
711 | 27 | 25 | ||
712 | 28 | # Check that the forward has been set | 26 | # Check that the forward has been set |
713 | 29 | self.assertThat( | 27 | self.assertThat( |
714 | @@ -52,7 +50,6 @@ | |||
715 | 52 | 50 | ||
716 | 53 | 51 | ||
717 | 54 | class PhoneDualSimTestCase(PhoneOfonoBaseTestCase): | 52 | class PhoneDualSimTestCase(PhoneOfonoBaseTestCase): |
718 | 55 | """Tests for Phone Page""" | ||
719 | 56 | 53 | ||
720 | 57 | use_sims = 2 | 54 | use_sims = 2 |
721 | 58 | 55 | ||
722 | @@ -73,7 +70,7 @@ | |||
723 | 73 | 70 | ||
724 | 74 | def test_call_fwd_sim_2(self): | 71 | def test_call_fwd_sim_2(self): |
725 | 75 | call_fwd_page = self.phone_page.go_to_call_forwarding(sim=2) | 72 | call_fwd_page = self.phone_page.go_to_call_forwarding(sim=2) |
727 | 76 | call_fwd_page.set_forward("41444424") | 73 | call_fwd_page.set_forward('41444424') |
728 | 77 | 74 | ||
729 | 78 | # Check that the forward has been set | 75 | # Check that the forward has been set |
730 | 79 | self.assertThat( | 76 | self.assertThat( |
731 | @@ -113,17 +110,3 @@ | |||
732 | 113 | lambda: str(self.modem_1.Get(CALL_SETTINGS_IFACE, | 110 | lambda: str(self.modem_1.Get(CALL_SETTINGS_IFACE, |
733 | 114 | 'VoiceCallWaiting')), | 111 | 'VoiceCallWaiting')), |
734 | 115 | Eventually(Contains('enabled'))) | 112 | Eventually(Contains('enabled'))) |
735 | 116 | |||
736 | 117 | |||
737 | 118 | class PhoneSoundTestCase(PhoneSoundBaseTestCase): | ||
738 | 119 | """Tests for Phone Page""" | ||
739 | 120 | |||
740 | 121 | def test_dialpad_sounds_switch(self): | ||
741 | 122 | """ Check that dialpad_sounds is present and clickable""" | ||
742 | 123 | snd = self.phone_page.select_single( | ||
743 | 124 | objectName="dialpadSounds") | ||
744 | 125 | prev_value = self.obj_test.GetDialpadSoundsEnabled() | ||
745 | 126 | self.system_settings.main_view.scroll_to_and_click(snd) | ||
746 | 127 | self.assertThat( | ||
747 | 128 | lambda: self.obj_test.GetDialpadSoundsEnabled(), | ||
748 | 129 | Eventually(NotEquals(prev_value))) | ||
749 | 130 | 113 | ||
750 | === added file 'tests/autopilot/ubuntu_system_settings/tests/test_phone_sound.py' | |||
751 | --- tests/autopilot/ubuntu_system_settings/tests/test_phone_sound.py 1970-01-01 00:00:00 +0000 | |||
752 | +++ tests/autopilot/ubuntu_system_settings/tests/test_phone_sound.py 2015-01-08 16:44:36 +0000 | |||
753 | @@ -0,0 +1,32 @@ | |||
754 | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- | ||
755 | 2 | # Copyright 2014 Canonical | ||
756 | 3 | # | ||
757 | 4 | # This program is free software: you can redistribute it and/or modify it | ||
758 | 5 | # under the terms of the GNU General Public License version 3, as published | ||
759 | 6 | # by the Free Software Foundation. | ||
760 | 7 | |||
761 | 8 | from __future__ import absolute_import | ||
762 | 9 | |||
763 | 10 | from autopilot.matchers import Eventually | ||
764 | 11 | from testtools.matchers import NotEquals | ||
765 | 12 | |||
766 | 13 | from ubuntu_system_settings.tests import SoundBaseTestCase | ||
767 | 14 | |||
768 | 15 | |||
769 | 16 | class PhoneSoundTestCase(SoundBaseTestCase): | ||
770 | 17 | """Tests for Phone Page""" | ||
771 | 18 | |||
772 | 19 | def setUp(self): | ||
773 | 20 | super(PhoneSoundTestCase, self).setUp(panel=None) | ||
774 | 21 | self.page = self.main_view.go_to_phone_page() | ||
775 | 22 | |||
776 | 23 | def test_dialpad_sounds_switch(self): | ||
777 | 24 | """ Check that dialpad_sounds is present and clickable""" | ||
778 | 25 | prev_value = self.obj_snd.GetDialpadSoundsEnabled() | ||
779 | 26 | if not prev_value: | ||
780 | 27 | self.page.enable_dialpad_sounds() | ||
781 | 28 | else: | ||
782 | 29 | self.page.disable_dialpad_sounds() | ||
783 | 30 | self.assertThat( | ||
784 | 31 | lambda: self.obj_snd.GetDialpadSoundsEnabled(), | ||
785 | 32 | Eventually(NotEquals(prev_value))) | ||
786 | 0 | 33 | ||
787 | === modified file 'tests/autopilot/ubuntu_system_settings/tests/test_plugins.py' | |||
788 | --- tests/autopilot/ubuntu_system_settings/tests/test_plugins.py 2014-04-04 15:31:49 +0000 | |||
789 | +++ tests/autopilot/ubuntu_system_settings/tests/test_plugins.py 2015-01-08 16:44:36 +0000 | |||
790 | @@ -25,7 +25,7 @@ | |||
791 | 25 | 25 | ||
792 | 26 | def test_title(self): | 26 | def test_title(self): |
793 | 27 | """ Checks whether the app title is correct """ | 27 | """ Checks whether the app title is correct """ |
795 | 28 | header = self.system_settings.main_view.select_single( | 28 | header = self.main_view.select_single( |
796 | 29 | objectName='systemSettingsPage' | 29 | objectName='systemSettingsPage' |
797 | 30 | ) | 30 | ) |
798 | 31 | self.assertThat(header, NotEquals(None)) | 31 | self.assertThat(header, NotEquals(None)) |
799 | @@ -33,14 +33,14 @@ | |||
800 | 33 | 33 | ||
801 | 34 | def test_search(self): | 34 | def test_search(self): |
802 | 35 | """ Checks whether the Search box is available """ | 35 | """ Checks whether the Search box is available """ |
804 | 36 | search = self.system_settings.main_view.select_single( | 36 | search = self.main_view.select_single( |
805 | 37 | objectName='searchTextField' | 37 | objectName='searchTextField' |
806 | 38 | ) | 38 | ) |
807 | 39 | self.assertThat(search, NotEquals(None)) | 39 | self.assertThat(search, NotEquals(None)) |
808 | 40 | 40 | ||
809 | 41 | def test_network_category(self): | 41 | def test_network_category(self): |
810 | 42 | """ Checks whether the Network category is available """ | 42 | """ Checks whether the Network category is available """ |
812 | 43 | category = self.system_settings.main_view.select_single( | 43 | category = self.main_view.select_single( |
813 | 44 | objectName='categoryGrid-network' | 44 | objectName='categoryGrid-network' |
814 | 45 | ) | 45 | ) |
815 | 46 | self.assertThat(category, NotEquals(None)) | 46 | self.assertThat(category, NotEquals(None)) |
816 | @@ -50,7 +50,7 @@ | |||
817 | 50 | 50 | ||
818 | 51 | def test_personal_category(self): | 51 | def test_personal_category(self): |
819 | 52 | """ Checks whether the Personal category is available """ | 52 | """ Checks whether the Personal category is available """ |
821 | 53 | category = self.system_settings.main_view.select_single( | 53 | category = self.main_view.select_single( |
822 | 54 | objectName='categoryGrid-personal' | 54 | objectName='categoryGrid-personal' |
823 | 55 | ) | 55 | ) |
824 | 56 | self.assertThat(category, NotEquals(None)) | 56 | self.assertThat(category, NotEquals(None)) |
825 | @@ -60,7 +60,7 @@ | |||
826 | 60 | 60 | ||
827 | 61 | def test_system_category(self): | 61 | def test_system_category(self): |
828 | 62 | """ Checks whether the System category is available """ | 62 | """ Checks whether the System category is available """ |
830 | 63 | category = self.system_settings.main_view.select_single( | 63 | category = self.main_view.select_single( |
831 | 64 | objectName='categoryGrid-system' | 64 | objectName='categoryGrid-system' |
832 | 65 | ) | 65 | ) |
833 | 66 | self.assertThat(category, NotEquals(None)) | 66 | self.assertThat(category, NotEquals(None)) |
834 | @@ -68,70 +68,70 @@ | |||
835 | 68 | 68 | ||
836 | 69 | def test_wifi_plugin(self): | 69 | def test_wifi_plugin(self): |
837 | 70 | """ Checks whether the Wi-Fi plugin is available """ | 70 | """ Checks whether the Wi-Fi plugin is available """ |
839 | 71 | plugin = self.system_settings.main_view.select_single( | 71 | plugin = self.main_view.select_single( |
840 | 72 | objectName='entryComponent-wifi' | 72 | objectName='entryComponent-wifi' |
841 | 73 | ) | 73 | ) |
842 | 74 | self.assertThat(plugin, NotEquals(None)) | 74 | self.assertThat(plugin, NotEquals(None)) |
843 | 75 | 75 | ||
844 | 76 | def test_cellular_plugin(self): | 76 | def test_cellular_plugin(self): |
845 | 77 | """ Checks whether the Cellunar plugin is available """ | 77 | """ Checks whether the Cellunar plugin is available """ |
847 | 78 | plugin = self.system_settings.main_view.select_single( | 78 | plugin = self.main_view.select_single( |
848 | 79 | objectName='entryComponent-cellular' | 79 | objectName='entryComponent-cellular' |
849 | 80 | ) | 80 | ) |
850 | 81 | self.assertThat(plugin, NotEquals(None)) | 81 | self.assertThat(plugin, NotEquals(None)) |
851 | 82 | 82 | ||
852 | 83 | def test_bluetooth_plugin(self): | 83 | def test_bluetooth_plugin(self): |
853 | 84 | """ Checks whether the Bluetooth plugin is available """ | 84 | """ Checks whether the Bluetooth plugin is available """ |
855 | 85 | plugin = self.system_settings.main_view.select_single( | 85 | plugin = self.main_view.select_single( |
856 | 86 | objectName='entryComponent-bluetooth' | 86 | objectName='entryComponent-bluetooth' |
857 | 87 | ) | 87 | ) |
858 | 88 | self.assertThat(plugin, NotEquals(None)) | 88 | self.assertThat(plugin, NotEquals(None)) |
859 | 89 | 89 | ||
860 | 90 | def test_background_plugin(self): | 90 | def test_background_plugin(self): |
861 | 91 | """ Checks whether the Background plugin is available """ | 91 | """ Checks whether the Background plugin is available """ |
863 | 92 | plugin = self.system_settings.main_view.select_single( | 92 | plugin = self.main_view.select_single( |
864 | 93 | objectName='entryComponent-background' | 93 | objectName='entryComponent-background' |
865 | 94 | ) | 94 | ) |
866 | 95 | self.assertThat(plugin, NotEquals(None)) | 95 | self.assertThat(plugin, NotEquals(None)) |
867 | 96 | 96 | ||
868 | 97 | def test_sound_plugin(self): | 97 | def test_sound_plugin(self): |
869 | 98 | """ Checks whether the Sound plugin is available """ | 98 | """ Checks whether the Sound plugin is available """ |
871 | 99 | plugin = self.system_settings.main_view.select_single( | 99 | plugin = self.main_view.select_single( |
872 | 100 | objectName='entryComponent-sound' | 100 | objectName='entryComponent-sound' |
873 | 101 | ) | 101 | ) |
874 | 102 | self.assertThat(plugin, NotEquals(None)) | 102 | self.assertThat(plugin, NotEquals(None)) |
875 | 103 | 103 | ||
876 | 104 | def test_language_plugin(self): | 104 | def test_language_plugin(self): |
877 | 105 | """ Checks whether the Language plugin is available """ | 105 | """ Checks whether the Language plugin is available """ |
879 | 106 | plugin = self.system_settings.main_view.select_single( | 106 | plugin = self.main_view.select_single( |
880 | 107 | objectName='entryComponent-language' | 107 | objectName='entryComponent-language' |
881 | 108 | ) | 108 | ) |
882 | 109 | self.assertThat(plugin, NotEquals(None)) | 109 | self.assertThat(plugin, NotEquals(None)) |
883 | 110 | 110 | ||
884 | 111 | def test_accounts_plugin(self): | 111 | def test_accounts_plugin(self): |
885 | 112 | """ Checks whether the Accounts plugin is available """ | 112 | """ Checks whether the Accounts plugin is available """ |
887 | 113 | plugin = self.system_settings.main_view.select_single( | 113 | plugin = self.main_view.select_single( |
888 | 114 | objectName='entryComponent-online-accounts' | 114 | objectName='entryComponent-online-accounts' |
889 | 115 | ) | 115 | ) |
890 | 116 | self.assertThat(plugin, NotEquals(None)) | 116 | self.assertThat(plugin, NotEquals(None)) |
891 | 117 | 117 | ||
892 | 118 | def test_timedate_plugin(self): | 118 | def test_timedate_plugin(self): |
893 | 119 | """ Checks whether the Time & Date plugin is available """ | 119 | """ Checks whether the Time & Date plugin is available """ |
895 | 120 | plugin = self.system_settings.main_view.select_single( | 120 | plugin = self.main_view.select_single( |
896 | 121 | objectName='entryComponent-time-date' | 121 | objectName='entryComponent-time-date' |
897 | 122 | ) | 122 | ) |
898 | 123 | self.assertThat(plugin, NotEquals(None)) | 123 | self.assertThat(plugin, NotEquals(None)) |
899 | 124 | 124 | ||
900 | 125 | def test_security_plugin(self): | 125 | def test_security_plugin(self): |
901 | 126 | """ Checks whether the Security plugin is available """ | 126 | """ Checks whether the Security plugin is available """ |
903 | 127 | plugin = self.system_settings.main_view.select_single( | 127 | plugin = self.main_view.select_single( |
904 | 128 | objectName='entryComponent-security-privacy' | 128 | objectName='entryComponent-security-privacy' |
905 | 129 | ) | 129 | ) |
906 | 130 | self.assertThat(plugin, NotEquals(None)) | 130 | self.assertThat(plugin, NotEquals(None)) |
907 | 131 | 131 | ||
908 | 132 | def test_updates_plugin(self): | 132 | def test_updates_plugin(self): |
909 | 133 | """ Checks whether the Updates plugin is available """ | 133 | """ Checks whether the Updates plugin is available """ |
911 | 134 | plugin = self.system_settings.main_view.select_single( | 134 | plugin = self.main_view.select_single( |
912 | 135 | objectName='entryComponent-system-update' | 135 | objectName='entryComponent-system-update' |
913 | 136 | ) | 136 | ) |
914 | 137 | self.assertThat(plugin, NotEquals(None)) | 137 | self.assertThat(plugin, NotEquals(None)) |
915 | @@ -144,7 +144,7 @@ | |||
916 | 144 | def test_no_battery_plugin_without_battery(self): | 144 | def test_no_battery_plugin_without_battery(self): |
917 | 145 | """ Checks whether the Battery plugin is not available | 145 | """ Checks whether the Battery plugin is not available |
918 | 146 | as we have no battery """ | 146 | as we have no battery """ |
920 | 147 | self.assertThat(lambda: self.system_settings.main_view.select_single( | 147 | self.assertThat(lambda: self.main_view.select_single( |
921 | 148 | objectName='entryComponent-battery'), | 148 | objectName='entryComponent-battery'), |
922 | 149 | raises(StateNotFoundError) | 149 | raises(StateNotFoundError) |
923 | 150 | ) | 150 | ) |
924 | @@ -152,7 +152,7 @@ | |||
925 | 152 | def test_battery_plugin_battery_hotplugging(self): | 152 | def test_battery_plugin_battery_hotplugging(self): |
926 | 153 | """ Checks whether hotplugging a battery makes the panel visible """ | 153 | """ Checks whether hotplugging a battery makes the panel visible """ |
927 | 154 | self.add_mock_battery() | 154 | self.add_mock_battery() |
929 | 155 | plugin = self.system_settings.main_view.select_single( | 155 | plugin = self.main_view.select_single( |
930 | 156 | objectName='entryComponent-battery' | 156 | objectName='entryComponent-battery' |
931 | 157 | ) | 157 | ) |
932 | 158 | self.assertThat(plugin, NotEquals(None)) | 158 | self.assertThat(plugin, NotEquals(None)) |
933 | @@ -164,7 +164,7 @@ | |||
934 | 164 | 164 | ||
935 | 165 | def test_battery_plugin(self): | 165 | def test_battery_plugin(self): |
936 | 166 | """ Checks whether the Battery plugin is available """ | 166 | """ Checks whether the Battery plugin is available """ |
938 | 167 | plugin = self.system_settings.main_view.select_single( | 167 | plugin = self.main_view.select_single( |
939 | 168 | objectName='entryComponent-battery' | 168 | objectName='entryComponent-battery' |
940 | 169 | ) | 169 | ) |
941 | 170 | self.assertThat(plugin, NotEquals(None)) | 170 | self.assertThat(plugin, NotEquals(None)) |
942 | 171 | 171 | ||
943 | === modified file 'tests/autopilot/ubuntu_system_settings/tests/test_search.py' | |||
944 | --- tests/autopilot/ubuntu_system_settings/tests/test_search.py 2014-08-22 16:20:46 +0000 | |||
945 | +++ tests/autopilot/ubuntu_system_settings/tests/test_search.py 2015-01-08 16:44:36 +0000 | |||
946 | @@ -22,19 +22,19 @@ | |||
947 | 22 | super(SearchTestCases, self).setUp() | 22 | super(SearchTestCases, self).setUp() |
948 | 23 | 23 | ||
949 | 24 | def _get_entry_component(self, name): | 24 | def _get_entry_component(self, name): |
951 | 25 | return self.system_settings.main_view.wait_select_single( | 25 | return self.main_view.wait_select_single( |
952 | 26 | objectName='entryComponent-' + name | 26 | objectName='entryComponent-' + name |
953 | 27 | ) | 27 | ) |
954 | 28 | 28 | ||
955 | 29 | def _get_all_entry_components(self): | 29 | def _get_all_entry_components(self): |
957 | 30 | return self.system_settings.main_view.select_many( | 30 | return self.main_view.select_many( |
958 | 31 | 'EntryComponent') | 31 | 'EntryComponent') |
959 | 32 | 32 | ||
960 | 33 | def _type_into_search_box(self, text): | 33 | def _type_into_search_box(self, text): |
962 | 34 | search_box = self.system_settings.main_view.select_single( | 34 | search_box = self.main_view.select_single( |
963 | 35 | objectName='searchTextField' | 35 | objectName='searchTextField' |
964 | 36 | ) | 36 | ) |
966 | 37 | self.system_settings.main_view.scroll_to_and_click(search_box) | 37 | self.main_view.scroll_to_and_click(search_box) |
967 | 38 | self.keyboard.type(_(text)) | 38 | self.keyboard.type(_(text)) |
968 | 39 | self.assertThat(search_box.text, Eventually(Equals(text))) | 39 | self.assertThat(search_box.text, Eventually(Equals(text))) |
969 | 40 | 40 | ||
970 | 41 | 41 | ||
971 | === modified file 'tests/autopilot/ubuntu_system_settings/tests/test_security.py' | |||
972 | --- tests/autopilot/ubuntu_system_settings/tests/test_security.py 2014-08-27 16:13:12 +0000 | |||
973 | +++ tests/autopilot/ubuntu_system_settings/tests/test_security.py 2015-01-08 16:44:36 +0000 | |||
974 | @@ -25,7 +25,7 @@ | |||
975 | 25 | def setUp(self): | 25 | def setUp(self): |
976 | 26 | super(SecurityTestCase, self).setUp() | 26 | super(SecurityTestCase, self).setUp() |
977 | 27 | self.assertEqual(['pin'], self.modem_0.Get(SIM_IFACE, 'LockedPins')) | 27 | self.assertEqual(['pin'], self.modem_0.Get(SIM_IFACE, 'LockedPins')) |
979 | 28 | prps = self.system_settings.main_view.security_page.get_properties() | 28 | prps = self.security_page.get_properties() |
980 | 29 | self.use_powerd = prps['usePowerd'] | 29 | self.use_powerd = prps['usePowerd'] |
981 | 30 | if self.use_powerd: | 30 | if self.use_powerd: |
982 | 31 | gsettings = Gio.Settings.new('com.ubuntu.touch.system') | 31 | gsettings = Gio.Settings.new('com.ubuntu.touch.system') |
983 | @@ -64,47 +64,49 @@ | |||
984 | 64 | 64 | ||
985 | 65 | def _go_to_phone_lock(self): | 65 | def _go_to_phone_lock(self): |
986 | 66 | selector = self.security_page.select_single( | 66 | selector = self.security_page.select_single( |
988 | 67 | objectName="lockingControl" | 67 | objectName='lockingControl' |
989 | 68 | ) | 68 | ) |
991 | 69 | self.system_settings.main_view.scroll_to_and_click(selector) | 69 | self.main_view.scroll_to_and_click(selector) |
992 | 70 | 70 | ||
993 | 71 | def _go_to_sim_lock(self): | 71 | def _go_to_sim_lock(self): |
994 | 72 | selector = self.security_page.select_single( | 72 | selector = self.security_page.select_single( |
996 | 73 | objectName="simControl" | 73 | objectName='simControl' |
997 | 74 | ) | 74 | ) |
999 | 75 | self.system_settings.main_view.scroll_to_and_click(selector) | 75 | self.main_view.scroll_to_and_click(selector) |
1000 | 76 | 76 | ||
1001 | 77 | def _go_to_sleep_values(self): | 77 | def _go_to_sleep_values(self): |
1002 | 78 | self._go_to_phone_lock() | 78 | self._go_to_phone_lock() |
1005 | 79 | selector = self.system_settings.main_view.select_single( | 79 | selector = self.main_view.select_single( |
1006 | 80 | objectName="lockTimeout" | 80 | objectName='lockTimeout' |
1007 | 81 | ) | 81 | ) |
1009 | 82 | self.system_settings.main_view.scroll_to_and_click(selector) | 82 | self.main_view.scroll_to_and_click(selector) |
1010 | 83 | 83 | ||
1011 | 84 | def _get_sleep_selector(self): | 84 | def _get_sleep_selector(self): |
1012 | 85 | self._go_to_sleep_values() | 85 | self._go_to_sleep_values() |
1015 | 86 | sleep_values_page = self.system_settings.main_view.select_single( | 86 | sleep_values_page = self.main_view.select_single( |
1016 | 87 | objectName='sleepValues') | 87 | objectName='sleepValues' |
1017 | 88 | ) | ||
1018 | 88 | self.assertThat( | 89 | self.assertThat( |
1019 | 89 | sleep_values_page, | 90 | sleep_values_page, |
1020 | 90 | NotEquals(None) | 91 | NotEquals(None) |
1021 | 91 | ) | 92 | ) |
1022 | 92 | self._go_to_sleep_values() | 93 | self._go_to_sleep_values() |
1025 | 93 | sleep_values_page = self.system_settings.main_view.select_single( | 94 | sleep_values_page = self.main_view.select_single( |
1026 | 94 | objectName='sleepValues') | 95 | objectName='sleepValues' |
1027 | 96 | ) | ||
1028 | 95 | return sleep_values_page.select_single( | 97 | return sleep_values_page.select_single( |
1029 | 96 | toolkit_emulators.ItemSelector, | 98 | toolkit_emulators.ItemSelector, |
1031 | 97 | objectName="sleepSelector" | 99 | objectName='sleepSelector' |
1032 | 98 | ) | 100 | ) |
1033 | 99 | 101 | ||
1034 | 100 | def test_security_page(self): | 102 | def test_security_page(self): |
1035 | 101 | """ Checks whether Security page is available """ | 103 | """ Checks whether Security page is available """ |
1036 | 102 | self.assertThat( | 104 | self.assertThat( |
1038 | 103 | self.system_settings.main_view.security_page, | 105 | self.security_page, |
1039 | 104 | NotEquals(None) | 106 | NotEquals(None) |
1040 | 105 | ) | 107 | ) |
1041 | 106 | self.assertThat( | 108 | self.assertThat( |
1043 | 107 | self.system_settings.main_view.security_page.title, | 109 | self.security_page.title, |
1044 | 108 | Equals(_('Security & Privacy')) | 110 | Equals(_('Security & Privacy')) |
1045 | 109 | ) | 111 | ) |
1046 | 110 | 112 | ||
1047 | @@ -125,8 +127,9 @@ | |||
1048 | 125 | 127 | ||
1049 | 126 | def test_phone_lock_page(self): | 128 | def test_phone_lock_page(self): |
1050 | 127 | self._go_to_phone_lock() | 129 | self._go_to_phone_lock() |
1053 | 128 | phone_lock_page = self.system_settings.main_view.select_single( | 130 | phone_lock_page = self.main_view.select_single( |
1054 | 129 | objectName='phoneLockingPage') | 131 | objectName='phoneLockingPage' |
1055 | 132 | ) | ||
1056 | 130 | self.assertThat( | 133 | self.assertThat( |
1057 | 131 | phone_lock_page, | 134 | phone_lock_page, |
1058 | 132 | NotEquals(None) | 135 | NotEquals(None) |
1059 | @@ -138,8 +141,9 @@ | |||
1060 | 138 | 141 | ||
1061 | 139 | def test_phone_lock_value(self): | 142 | def test_phone_lock_value(self): |
1062 | 140 | self._go_to_phone_lock() | 143 | self._go_to_phone_lock() |
1065 | 141 | phone_lock_page = self.system_settings.main_view.select_single( | 144 | phone_lock_page = self.main_view.select_single( |
1066 | 142 | objectName='phoneLockingPage') | 145 | objectName='phoneLockingPage' |
1067 | 146 | ) | ||
1068 | 143 | actTimeout = self._get_activity_timeout() | 147 | actTimeout = self._get_activity_timeout() |
1069 | 144 | activityTimeout = phone_lock_page.select_single( | 148 | activityTimeout = phone_lock_page.select_single( |
1070 | 145 | objectName='lockTimeout').value | 149 | objectName='lockTimeout').value |
1071 | @@ -160,7 +164,7 @@ | |||
1072 | 160 | selector = self._get_sleep_selector() | 164 | selector = self._get_sleep_selector() |
1073 | 161 | to_select = selector.select_single( | 165 | to_select = selector.select_single( |
1074 | 162 | 'OptionSelectorDelegate', text='Never') | 166 | 'OptionSelectorDelegate', text='Never') |
1076 | 163 | self.system_settings.main_view.pointing_device.click_object(to_select) | 167 | self.main_view.pointing_device.click_object(to_select) |
1077 | 164 | to_select.selected.wait_for(True) | 168 | to_select.selected.wait_for(True) |
1078 | 165 | sleep(1) | 169 | sleep(1) |
1079 | 166 | actTimeout = self._get_activity_timeout() | 170 | actTimeout = self._get_activity_timeout() |
1080 | @@ -173,7 +177,7 @@ | |||
1081 | 173 | selector = self._get_sleep_selector() | 177 | selector = self._get_sleep_selector() |
1082 | 174 | to_select = selector.select_single( | 178 | to_select = selector.select_single( |
1083 | 175 | 'OptionSelectorDelegate', text='After 4 minutes') | 179 | 'OptionSelectorDelegate', text='After 4 minutes') |
1085 | 176 | self.system_settings.main_view.pointing_device.click_object(to_select) | 180 | self.main_view.pointing_device.click_object(to_select) |
1086 | 177 | to_select.selected.wait_for(True) | 181 | to_select.selected.wait_for(True) |
1087 | 178 | sleep(1) | 182 | sleep(1) |
1088 | 179 | actTimeout = self._get_activity_timeout() | 183 | actTimeout = self._get_activity_timeout() |
1089 | @@ -196,31 +200,36 @@ | |||
1090 | 196 | 200 | ||
1091 | 197 | def test_sim_pin_lock_control(self): | 201 | def test_sim_pin_lock_control(self): |
1092 | 198 | self._go_to_sim_lock() | 202 | self._go_to_sim_lock() |
1095 | 199 | sim_lock_control = self.system_settings.main_view.select_single( | 203 | sim_lock_control = self.main_view.select_single( |
1096 | 200 | objectName='simPinSwitch') | 204 | objectName='simPinSwitch' |
1097 | 205 | ) | ||
1098 | 201 | locked = len(self.modem_0.Get(SIM_IFACE, 'LockedPins')) > 0 | 206 | locked = len(self.modem_0.Get(SIM_IFACE, 'LockedPins')) > 0 |
1099 | 202 | self.assertEquals(locked, sim_lock_control.checked) | 207 | self.assertEquals(locked, sim_lock_control.checked) |
1100 | 203 | 208 | ||
1101 | 204 | def test_sim_pin_lock_control_unlock(self): | 209 | def test_sim_pin_lock_control_unlock(self): |
1102 | 205 | self._go_to_sim_lock() | 210 | self._go_to_sim_lock() |
1105 | 206 | sim_lock_control = self.system_settings.main_view.select_single( | 211 | sim_lock_control = self.main_view.select_single( |
1106 | 207 | objectName='simPinSwitch') | 212 | objectName='simPinSwitch' |
1107 | 213 | ) | ||
1108 | 208 | 214 | ||
1109 | 209 | self.assertTrue(sim_lock_control.checked) | 215 | self.assertTrue(sim_lock_control.checked) |
1110 | 210 | 216 | ||
1112 | 211 | self.system_settings.main_view.scroll_to_and_click(sim_lock_control) | 217 | self.main_view.scroll_to_and_click(sim_lock_control) |
1113 | 212 | 218 | ||
1116 | 213 | lock_dialog = self.system_settings.main_view.select_single( | 219 | lock_dialog = self.main_view.select_single( |
1117 | 214 | objectName='lockDialogComponent') | 220 | objectName='lockDialogComponent' |
1118 | 221 | ) | ||
1119 | 215 | self.assertEqual( | 222 | self.assertEqual( |
1120 | 216 | lock_dialog.title, | 223 | lock_dialog.title, |
1121 | 217 | _("Enter SIM PIN") | 224 | _("Enter SIM PIN") |
1122 | 218 | ) | 225 | ) |
1123 | 219 | 226 | ||
1128 | 220 | prev_input = self.system_settings.main_view.select_single( | 227 | prev_input = self.main_view.select_single( |
1129 | 221 | objectName='prevInput') | 228 | objectName='prevInput' |
1130 | 222 | submit_button = self.system_settings.main_view.select_single( | 229 | ) |
1131 | 223 | objectName='lockButton') | 230 | submit_button = self.main_view.select_single( |
1132 | 231 | objectName='lockButton' | ||
1133 | 232 | ) | ||
1134 | 224 | 233 | ||
1135 | 225 | self.assertEqual( | 234 | self.assertEqual( |
1136 | 226 | submit_button.text, | 235 | submit_button.text, |
1137 | @@ -230,7 +239,7 @@ | |||
1138 | 230 | self.assertFalse( | 239 | self.assertFalse( |
1139 | 231 | submit_button.get_properties()['enabled'] | 240 | submit_button.get_properties()['enabled'] |
1140 | 232 | ) | 241 | ) |
1142 | 233 | self.system_settings.main_view.scroll_to_and_click(prev_input) | 242 | self.main_view.scroll_to_and_click(prev_input) |
1143 | 234 | self.keyboard.type("246") | 243 | self.keyboard.type("246") |
1144 | 235 | self.assertFalse( | 244 | self.assertFalse( |
1145 | 236 | submit_button.get_properties()['enabled'] | 245 | submit_button.get_properties()['enabled'] |
1146 | @@ -241,7 +250,7 @@ | |||
1147 | 241 | submit_button.get_properties()['enabled'] | 250 | submit_button.get_properties()['enabled'] |
1148 | 242 | ) | 251 | ) |
1149 | 243 | 252 | ||
1151 | 244 | self.system_settings.main_view.scroll_to_and_click(submit_button) | 253 | self.main_view.scroll_to_and_click(submit_button) |
1152 | 245 | 254 | ||
1153 | 246 | self.assertFalse(sim_lock_control.checked) | 255 | self.assertFalse(sim_lock_control.checked) |
1154 | 247 | 256 | ||
1155 | @@ -252,24 +261,28 @@ | |||
1156 | 252 | def test_sim_pin_lock_control_lock(self): | 261 | def test_sim_pin_lock_control_lock(self): |
1157 | 253 | self.modem_0.Set(SIM_IFACE, 'LockedPins', "") | 262 | self.modem_0.Set(SIM_IFACE, 'LockedPins', "") |
1158 | 254 | self._go_to_sim_lock() | 263 | self._go_to_sim_lock() |
1161 | 255 | sim_lock_control = self.system_settings.main_view.select_single( | 264 | sim_lock_control = self.main_view.select_single( |
1162 | 256 | objectName='simPinSwitch') | 265 | objectName='simPinSwitch' |
1163 | 266 | ) | ||
1164 | 257 | 267 | ||
1165 | 258 | self.assertFalse(sim_lock_control.checked) | 268 | self.assertFalse(sim_lock_control.checked) |
1166 | 259 | 269 | ||
1168 | 260 | self.system_settings.main_view.scroll_to_and_click(sim_lock_control) | 270 | self.main_view.scroll_to_and_click(sim_lock_control) |
1169 | 261 | 271 | ||
1172 | 262 | lock_dialog = self.system_settings.main_view.select_single( | 272 | lock_dialog = self.main_view.select_single( |
1173 | 263 | objectName='lockDialogComponent') | 273 | objectName='lockDialogComponent' |
1174 | 274 | ) | ||
1175 | 264 | self.assertEqual( | 275 | self.assertEqual( |
1176 | 265 | lock_dialog.title, | 276 | lock_dialog.title, |
1177 | 266 | _("Enter SIM PIN") | 277 | _("Enter SIM PIN") |
1178 | 267 | ) | 278 | ) |
1179 | 268 | 279 | ||
1184 | 269 | prev_input = self.system_settings.main_view.select_single( | 280 | prev_input = self.main_view.select_single( |
1185 | 270 | objectName='prevInput') | 281 | objectName='prevInput' |
1186 | 271 | submit_button = self.system_settings.main_view.select_single( | 282 | ) |
1187 | 272 | objectName='lockButton') | 283 | submit_button = self.main_view.select_single( |
1188 | 284 | objectName='lockButton' | ||
1189 | 285 | ) | ||
1190 | 273 | 286 | ||
1191 | 274 | self.assertEqual( | 287 | self.assertEqual( |
1192 | 275 | submit_button.text, | 288 | submit_button.text, |
1193 | @@ -279,7 +292,7 @@ | |||
1194 | 279 | self.assertFalse( | 292 | self.assertFalse( |
1195 | 280 | submit_button.get_properties()['enabled'] | 293 | submit_button.get_properties()['enabled'] |
1196 | 281 | ) | 294 | ) |
1198 | 282 | self.system_settings.main_view.scroll_to_and_click(prev_input) | 295 | self.main_view.scroll_to_and_click(prev_input) |
1199 | 283 | self.keyboard.type("246") | 296 | self.keyboard.type("246") |
1200 | 284 | self.assertFalse( | 297 | self.assertFalse( |
1201 | 285 | submit_button.get_properties()['enabled'] | 298 | submit_button.get_properties()['enabled'] |
1202 | @@ -290,7 +303,7 @@ | |||
1203 | 290 | submit_button.get_properties()['enabled'] | 303 | submit_button.get_properties()['enabled'] |
1204 | 291 | ) | 304 | ) |
1205 | 292 | 305 | ||
1207 | 293 | self.system_settings.main_view.scroll_to_and_click(submit_button) | 306 | self.main_view.scroll_to_and_click(submit_button) |
1208 | 294 | 307 | ||
1209 | 295 | self.assertTrue(sim_lock_control.checked) | 308 | self.assertTrue(sim_lock_control.checked) |
1210 | 296 | 309 | ||
1211 | @@ -300,27 +313,31 @@ | |||
1212 | 300 | 313 | ||
1213 | 301 | def test_sim_pin_lock_control_unlock_fail(self): | 314 | def test_sim_pin_lock_control_unlock_fail(self): |
1214 | 302 | self._go_to_sim_lock() | 315 | self._go_to_sim_lock() |
1217 | 303 | sim_lock_control = self.system_settings.main_view.select_single( | 316 | sim_lock_control = self.main_view.select_single( |
1218 | 304 | objectName='simPinSwitch') | 317 | objectName='simPinSwitch' |
1219 | 318 | ) | ||
1220 | 305 | 319 | ||
1221 | 306 | self.assertTrue( | 320 | self.assertTrue( |
1222 | 307 | len(self.modem_0.Get(SIM_IFACE, 'LockedPins')) > 0 | 321 | len(self.modem_0.Get(SIM_IFACE, 'LockedPins')) > 0 |
1223 | 308 | ) | 322 | ) |
1224 | 309 | self.assertTrue(sim_lock_control.checked) | 323 | self.assertTrue(sim_lock_control.checked) |
1225 | 310 | 324 | ||
1227 | 311 | self.system_settings.main_view.scroll_to_and_click(sim_lock_control) | 325 | self.main_view.scroll_to_and_click(sim_lock_control) |
1228 | 312 | 326 | ||
1231 | 313 | lock_dialog = self.system_settings.main_view.select_single( | 327 | lock_dialog = self.main_view.select_single( |
1232 | 314 | objectName='lockDialogComponent') | 328 | objectName='lockDialogComponent' |
1233 | 329 | ) | ||
1234 | 315 | self.assertEqual( | 330 | self.assertEqual( |
1235 | 316 | lock_dialog.title, | 331 | lock_dialog.title, |
1236 | 317 | _("Enter SIM PIN") | 332 | _("Enter SIM PIN") |
1237 | 318 | ) | 333 | ) |
1238 | 319 | 334 | ||
1243 | 320 | prev_input = self.system_settings.main_view.select_single( | 335 | prev_input = self.main_view.select_single( |
1244 | 321 | objectName='prevInput') | 336 | objectName='prevInput' |
1245 | 322 | submit_button = self.system_settings.main_view.select_single( | 337 | ) |
1246 | 323 | objectName='lockButton') | 338 | submit_button = self.main_view.select_single( |
1247 | 339 | objectName='lockButton' | ||
1248 | 340 | ) | ||
1249 | 324 | 341 | ||
1250 | 325 | self.assertEqual( | 342 | self.assertEqual( |
1251 | 326 | submit_button.text, | 343 | submit_button.text, |
1252 | @@ -330,14 +347,14 @@ | |||
1253 | 330 | self.assertFalse( | 347 | self.assertFalse( |
1254 | 331 | submit_button.get_properties()['enabled'] | 348 | submit_button.get_properties()['enabled'] |
1255 | 332 | ) | 349 | ) |
1257 | 333 | self.system_settings.main_view.scroll_to_and_click(prev_input) | 350 | self.main_view.scroll_to_and_click(prev_input) |
1258 | 334 | self.keyboard.type("1234") | 351 | self.keyboard.type("1234") |
1259 | 335 | 352 | ||
1260 | 336 | self.assertTrue( | 353 | self.assertTrue( |
1261 | 337 | submit_button.get_properties()['enabled'] | 354 | submit_button.get_properties()['enabled'] |
1262 | 338 | ) | 355 | ) |
1263 | 339 | 356 | ||
1265 | 340 | self.system_settings.main_view.scroll_to_and_click(submit_button) | 357 | self.main_view.scroll_to_and_click(submit_button) |
1266 | 341 | 358 | ||
1267 | 342 | self.assertTrue( | 359 | self.assertTrue( |
1268 | 343 | len(self.modem_0.Get(SIM_IFACE, 'LockedPins')) > 0 | 360 | len(self.modem_0.Get(SIM_IFACE, 'LockedPins')) > 0 |
1269 | @@ -347,26 +364,30 @@ | |||
1270 | 347 | def test_sim_pin_lock_control_lock_fail(self): | 364 | def test_sim_pin_lock_control_lock_fail(self): |
1271 | 348 | self.modem_0.Set(SIM_IFACE, 'LockedPins', "") | 365 | self.modem_0.Set(SIM_IFACE, 'LockedPins', "") |
1272 | 349 | self._go_to_sim_lock() | 366 | self._go_to_sim_lock() |
1275 | 350 | sim_lock_control = self.system_settings.main_view.select_single( | 367 | sim_lock_control = self.main_view.select_single( |
1276 | 351 | objectName='simPinSwitch') | 368 | objectName='simPinSwitch' |
1277 | 369 | ) | ||
1278 | 352 | 370 | ||
1279 | 353 | self.assertFalse( | 371 | self.assertFalse( |
1280 | 354 | len(self.modem_0.Get(SIM_IFACE, 'LockedPins')) > 0 | 372 | len(self.modem_0.Get(SIM_IFACE, 'LockedPins')) > 0 |
1281 | 355 | ) | 373 | ) |
1282 | 356 | 374 | ||
1284 | 357 | self.system_settings.main_view.scroll_to_and_click(sim_lock_control) | 375 | self.main_view.scroll_to_and_click(sim_lock_control) |
1285 | 358 | 376 | ||
1288 | 359 | lock_dialog = self.system_settings.main_view.select_single( | 377 | lock_dialog = self.main_view.select_single( |
1289 | 360 | objectName='lockDialogComponent') | 378 | objectName='lockDialogComponent' |
1290 | 379 | ) | ||
1291 | 361 | self.assertEqual( | 380 | self.assertEqual( |
1292 | 362 | lock_dialog.title, | 381 | lock_dialog.title, |
1293 | 363 | _("Enter SIM PIN") | 382 | _("Enter SIM PIN") |
1294 | 364 | ) | 383 | ) |
1295 | 365 | 384 | ||
1300 | 366 | prev_input = self.system_settings.main_view.select_single( | 385 | prev_input = self.main_view.select_single( |
1301 | 367 | objectName='prevInput') | 386 | objectName='prevInput' |
1302 | 368 | submit_button = self.system_settings.main_view.select_single( | 387 | ) |
1303 | 369 | objectName='lockButton') | 388 | submit_button = self.main_view.select_single( |
1304 | 389 | objectName='lockButton' | ||
1305 | 390 | ) | ||
1306 | 370 | 391 | ||
1307 | 371 | self.assertEqual( | 392 | self.assertEqual( |
1308 | 372 | submit_button.text, | 393 | submit_button.text, |
1309 | @@ -376,14 +397,14 @@ | |||
1310 | 376 | self.assertFalse( | 397 | self.assertFalse( |
1311 | 377 | submit_button.get_properties()['enabled'] | 398 | submit_button.get_properties()['enabled'] |
1312 | 378 | ) | 399 | ) |
1314 | 379 | self.system_settings.main_view.scroll_to_and_click(prev_input) | 400 | self.main_view.scroll_to_and_click(prev_input) |
1315 | 380 | self.keyboard.type("1234") | 401 | self.keyboard.type("1234") |
1316 | 381 | 402 | ||
1317 | 382 | self.assertTrue( | 403 | self.assertTrue( |
1318 | 383 | submit_button.get_properties()['enabled'] | 404 | submit_button.get_properties()['enabled'] |
1319 | 384 | ) | 405 | ) |
1320 | 385 | 406 | ||
1322 | 386 | self.system_settings.main_view.scroll_to_and_click(submit_button) | 407 | self.main_view.scroll_to_and_click(submit_button) |
1323 | 387 | 408 | ||
1324 | 388 | self.assertFalse( | 409 | self.assertFalse( |
1325 | 389 | len(self.modem_0.Get(SIM_IFACE, 'LockedPins')) > 0 | 410 | len(self.modem_0.Get(SIM_IFACE, 'LockedPins')) > 0 |
1326 | 390 | 411 | ||
1327 | === modified file 'tests/autopilot/ubuntu_system_settings/tests/test_sound.py' | |||
1328 | --- tests/autopilot/ubuntu_system_settings/tests/test_sound.py 2014-11-13 16:52:09 +0000 | |||
1329 | +++ tests/autopilot/ubuntu_system_settings/tests/test_sound.py 2015-01-08 16:44:36 +0000 | |||
1330 | @@ -19,19 +19,20 @@ | |||
1331 | 19 | def test_sound_page(self): | 19 | def test_sound_page(self): |
1332 | 20 | """ Checks whether Sound page is available """ | 20 | """ Checks whether Sound page is available """ |
1333 | 21 | self.assertThat( | 21 | self.assertThat( |
1335 | 22 | self.system_settings.main_view.sound_page, | 22 | self.sound_page, |
1336 | 23 | NotEquals(None) | 23 | NotEquals(None) |
1337 | 24 | ) | 24 | ) |
1338 | 25 | self.assertThat( | 25 | self.assertThat( |
1340 | 26 | self.system_settings.main_view.sound_page.title, | 26 | self.sound_page.title, |
1341 | 27 | Equals(_('Sound')) | 27 | Equals(_('Sound')) |
1342 | 28 | ) | 28 | ) |
1343 | 29 | 29 | ||
1344 | 30 | def test_silent_mode_sound_switch(self): | 30 | def test_silent_mode_sound_switch(self): |
1345 | 31 | """ Check that silent_mode is present and clickable""" | 31 | """ Check that silent_mode is present and clickable""" |
1349 | 32 | snd = self.system_settings.main_view.sound_page.select_single( | 32 | snd = self.sound_page.select_single( |
1350 | 33 | objectName="silentMode") | 33 | objectName="silentMode" |
1351 | 34 | self.system_settings.main_view.scroll_to_and_click(snd) | 34 | ) |
1352 | 35 | self.main_view.scroll_to_and_click(snd) | ||
1353 | 35 | sleep(0.2) | 36 | sleep(0.2) |
1354 | 36 | calls = self.dbus_mock_isound.GetCalls() | 37 | calls = self.dbus_mock_isound.GetCalls() |
1355 | 37 | self.assertThat( | 38 | self.assertThat( |
1356 | @@ -45,63 +46,56 @@ | |||
1357 | 45 | 46 | ||
1358 | 46 | def test_call_vibrate_sound_switch(self): | 47 | def test_call_vibrate_sound_switch(self): |
1359 | 47 | """ Check that call vibrate is present and clickable""" | 48 | """ Check that call vibrate is present and clickable""" |
1378 | 48 | snd = self.system_settings.main_view.sound_page.select_single( | 49 | snd = self.sound_page.select_single( |
1379 | 49 | objectName="callVibrate") | 50 | objectName="callVibrate" |
1380 | 50 | prev_value = self.obj_test.GetIncomingCallVibrate() | 51 | ) |
1381 | 51 | self.system_settings.main_view.scroll_to_and_click(snd) | 52 | prev_value = self.obj_snd.GetIncomingCallVibrate() |
1382 | 52 | sleep(0.2) | 53 | self.main_view.scroll_to_and_click(snd) |
1383 | 53 | self.assertNotEqual( | 54 | sleep(0.2) |
1384 | 54 | self.obj_test.GetIncomingCallVibrate(), | 55 | self.assertNotEqual( |
1385 | 55 | prev_value) | 56 | self.obj_snd.GetIncomingCallVibrate(), |
1368 | 56 | |||
1369 | 57 | def test_call_vibrate_silent_mode_sound_switch(self): | ||
1370 | 58 | """ Check that call vibrate silent mode is present and clickable""" | ||
1371 | 59 | snd = self.system_settings.main_view.sound_page.select_single( | ||
1372 | 60 | objectName="callVibrateSilentMode") | ||
1373 | 61 | prev_value = self.obj_test.GetIncomingCallVibrateSilentMode() | ||
1374 | 62 | self.system_settings.main_view.scroll_to_and_click(snd) | ||
1375 | 63 | sleep(0.2) | ||
1376 | 64 | self.assertNotEqual( | ||
1377 | 65 | self.obj_test.GetIncomingCallVibrateSilentMode(), | ||
1386 | 66 | prev_value) | 57 | prev_value) |
1387 | 67 | 58 | ||
1388 | 68 | def test_message_vibrate_sound_switch(self): | 59 | def test_message_vibrate_sound_switch(self): |
1389 | 69 | """ Check that message vibrate is present and clickable""" | 60 | """ Check that message vibrate is present and clickable""" |
1394 | 70 | snd = self.system_settings.main_view.sound_page.select_single( | 61 | snd = self.sound_page.select_single( |
1395 | 71 | objectName="messageVibrate") | 62 | objectName="messageVibrate" |
1396 | 72 | prev_value = self.obj_test.GetIncomingMessageVibrate() | 63 | ) |
1397 | 73 | self.system_settings.main_view.scroll_to_and_click(snd) | 64 | prev_value = self.obj_snd.GetIncomingMessageVibrate() |
1398 | 65 | self.main_view.scroll_to_and_click(snd) | ||
1399 | 74 | sleep(0.2) | 66 | sleep(0.2) |
1400 | 75 | self.assertNotEqual( | 67 | self.assertNotEqual( |
1402 | 76 | self.obj_test.GetIncomingMessageVibrate(), | 68 | self.obj_snd.GetIncomingMessageVibrate(), |
1403 | 77 | prev_value) | 69 | prev_value) |
1404 | 78 | 70 | ||
1405 | 79 | def test_message_vibrate_silent_mode_sound_switch(self): | 71 | def test_message_vibrate_silent_mode_sound_switch(self): |
1406 | 80 | """ Check that message vibrate silent mode is present and clickable""" | 72 | """ Check that message vibrate silent mode is present and clickable""" |
1411 | 81 | snd = self.system_settings.main_view.sound_page.select_single( | 73 | snd = self.sound_page.select_single( |
1412 | 82 | objectName="messageVibrateSilentMode") | 74 | objectName="messageVibrateSilentMode" |
1413 | 83 | prev_value = self.obj_test.GetIncomingMessageVibrateSilentMode() | 75 | ) |
1414 | 84 | self.system_settings.main_view.scroll_to_and_click(snd) | 76 | prev_value = self.obj_snd.GetIncomingMessageVibrateSilentMode() |
1415 | 77 | self.main_view.scroll_to_and_click(snd) | ||
1416 | 85 | sleep(0.2) | 78 | sleep(0.2) |
1417 | 86 | self.assertNotEqual( | 79 | self.assertNotEqual( |
1419 | 87 | self.obj_test.GetIncomingMessageVibrateSilentMode(), | 80 | self.obj_snd.GetIncomingMessageVibrateSilentMode(), |
1420 | 88 | prev_value) | 81 | prev_value) |
1421 | 89 | 82 | ||
1422 | 90 | def test_keyboard_sound_switch(self): | 83 | def test_keyboard_sound_switch(self): |
1423 | 91 | """ Check that keyboard sound is present and clickable""" | 84 | """ Check that keyboard sound is present and clickable""" |
1426 | 92 | kbd_snd = self.system_settings.main_view.sound_page.select_single( | 85 | kbd_snd = self.sound_page.select_single( |
1427 | 93 | objectName="keyboardSoundSwitch") | 86 | objectName="keyboardSoundSwitch" |
1428 | 87 | ) | ||
1429 | 94 | current_value = kbd_snd.get_properties()["checked"] | 88 | current_value = kbd_snd.get_properties()["checked"] |
1431 | 95 | self.system_settings.main_view.scroll_to_and_click(kbd_snd) | 89 | self.main_view.scroll_to_and_click(kbd_snd) |
1432 | 96 | self.assertThat( | 90 | self.assertThat( |
1433 | 97 | kbd_snd.get_properties()["checked"], NotEquals(current_value)) | 91 | kbd_snd.get_properties()["checked"], NotEquals(current_value)) |
1434 | 98 | 92 | ||
1435 | 99 | def test_dialpad_sounds_switch(self): | 93 | def test_dialpad_sounds_switch(self): |
1441 | 100 | """ Check that dialpad_sounds is present and clickable""" | 94 | snd = self.sound_page.select_single( |
1442 | 101 | snd = self.system_settings.main_view.sound_page.select_single( | 95 | objectName="dialpadSounds" |
1443 | 102 | objectName="dialpadSounds") | 96 | ) |
1444 | 103 | prev_value = self.obj_test.GetDialpadSoundsEnabled() | 97 | prev_value = self.obj_snd.GetDialpadSoundsEnabled() |
1445 | 104 | self.system_settings.main_view.scroll_to_and_click(snd) | 98 | self.main_view.scroll_to_and_click(snd) |
1446 | 105 | self.assertThat( | 99 | self.assertThat( |
1448 | 106 | lambda: self.obj_test.GetDialpadSoundsEnabled(), | 100 | lambda: self.obj_snd.GetDialpadSoundsEnabled(), |
1449 | 107 | Eventually(NotEquals(prev_value))) | 101 | Eventually(NotEquals(prev_value))) |
1450 | 108 | 102 | ||
1451 | === modified file 'tests/autopilot/ubuntu_system_settings/tests/test_wifi.py' | |||
1452 | --- tests/autopilot/ubuntu_system_settings/tests/test_wifi.py 2014-10-21 15:26:59 +0000 | |||
1453 | +++ tests/autopilot/ubuntu_system_settings/tests/test_wifi.py 2015-01-08 16:44:36 +0000 | |||
1454 | @@ -32,7 +32,7 @@ | |||
1455 | 32 | self.wifi_page.enable_wireless() | 32 | self.wifi_page.enable_wireless() |
1456 | 33 | dialog = self.wifi_page.connect_to_hidden_network( | 33 | dialog = self.wifi_page.connect_to_hidden_network( |
1457 | 34 | 'yeah', | 34 | 'yeah', |
1459 | 35 | scroll_to_and_click=self.system_settings.main_view | 35 | scroll_to_and_click=self.main_view |
1460 | 36 | .scroll_to_and_click) | 36 | .scroll_to_and_click) |
1461 | 37 | 37 | ||
1462 | 38 | # allow backend to set up listeners | 38 | # allow backend to set up listeners |
1463 | @@ -59,7 +59,7 @@ | |||
1464 | 59 | self.wifi_page.enable_wireless() | 59 | self.wifi_page.enable_wireless() |
1465 | 60 | dialog = self.wifi_page.connect_to_hidden_network( | 60 | dialog = self.wifi_page.connect_to_hidden_network( |
1466 | 61 | 'yeah', | 61 | 'yeah', |
1468 | 62 | scroll_to_and_click=self.system_settings.main_view | 62 | scroll_to_and_click=self.main_view |
1469 | 63 | .scroll_to_and_click) | 63 | .scroll_to_and_click) |
1470 | 64 | 64 | ||
1471 | 65 | # allow backend to set up listeners | 65 | # allow backend to set up listeners |
1472 | @@ -88,7 +88,7 @@ | |||
1473 | 88 | self.wifi_page.enable_wireless() | 88 | self.wifi_page.enable_wireless() |
1474 | 89 | dialog = self.wifi_page.connect_to_hidden_network( | 89 | dialog = self.wifi_page.connect_to_hidden_network( |
1475 | 90 | 'yeah', security='wpa', password='abcdefgh', | 90 | 'yeah', security='wpa', password='abcdefgh', |
1477 | 91 | scroll_to_and_click=self.system_settings.main_view | 91 | scroll_to_and_click=self.main_view |
1478 | 92 | .scroll_to_and_click) | 92 | .scroll_to_and_click) |
1479 | 93 | 93 | ||
1480 | 94 | # allow backend to set up listeners | 94 | # allow backend to set up listeners |
1481 | @@ -116,7 +116,7 @@ | |||
1482 | 116 | self.wifi_page.enable_wireless() | 116 | self.wifi_page.enable_wireless() |
1483 | 117 | dialog = self.wifi_page.connect_to_hidden_network( | 117 | dialog = self.wifi_page.connect_to_hidden_network( |
1484 | 118 | 'yeah', security='wpa', password='abcdefgh', | 118 | 'yeah', security='wpa', password='abcdefgh', |
1486 | 119 | scroll_to_and_click=self.system_settings.main_view | 119 | scroll_to_and_click=self.main_view |
1487 | 120 | .scroll_to_and_click) | 120 | .scroll_to_and_click) |
1488 | 121 | # allow backend to set up listeners | 121 | # allow backend to set up listeners |
1489 | 122 | sleep(0.3) | 122 | sleep(0.3) |
1490 | @@ -143,7 +143,7 @@ | |||
1491 | 143 | self.wifi_page.enable_wireless() | 143 | self.wifi_page.enable_wireless() |
1492 | 144 | dialog = self.wifi_page.connect_to_hidden_network( | 144 | dialog = self.wifi_page.connect_to_hidden_network( |
1493 | 145 | 'foo', | 145 | 'foo', |
1495 | 146 | scroll_to_and_click=self.system_settings.main_view | 146 | scroll_to_and_click=self.main_view |
1496 | 147 | .scroll_to_and_click) | 147 | .scroll_to_and_click) |
1497 | 148 | 148 | ||
1498 | 149 | # allow backend to set up listeners | 149 | # allow backend to set up listeners |
1499 | @@ -173,7 +173,7 @@ | |||
1500 | 173 | The NetworkManager dbusmock template does not currently support deletion | 173 | The NetworkManager dbusmock template does not currently support deletion |
1501 | 174 | of connections.""" | 174 | of connections.""" |
1502 | 175 | def test_remove_previous_network(self): | 175 | def test_remove_previous_network(self): |
1504 | 176 | click_method = self.system_settings.main_view.scroll_to_and_click | 176 | click_method = self.main_view.scroll_to_and_click |
1505 | 177 | previous_networks = [{ | 177 | previous_networks = [{ |
1506 | 178 | 'ssid': 'Series of Tubes', | 178 | 'ssid': 'Series of Tubes', |
1507 | 179 | 'connection_name': 'conn_0' | 179 | 'connection_name': 'conn_0' |
1508 | @@ -190,7 +190,7 @@ | |||
1509 | 190 | self.wifi_page.remove_previous_network( | 190 | self.wifi_page.remove_previous_network( |
1510 | 191 | previous_networks[0]['ssid'], scroll_to_and_click=click_method) | 191 | previous_networks[0]['ssid'], scroll_to_and_click=click_method) |
1511 | 192 | 192 | ||
1513 | 193 | self.system_settings.main_view.go_back() | 193 | self.main_view.go_back() |
1514 | 194 | 194 | ||
1515 | 195 | # wait for ui to update | 195 | # wait for ui to update |
1516 | 196 | sleep(2) | 196 | sleep(2) |
FAILED: Continuous integration, rev:1229 /code.launchpad .net/~elopio/ ubuntu- system- settings/ my_less_ flaky/+ merge/245879/ +edit-commit- message
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http:// jenkins. qa.ubuntu. com/job/ ubuntu- system- settings- ci/1886/ jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- vivid-touch/ 739 jenkins. qa.ubuntu. com/job/ ubuntu- system- settings- vivid-i386- ci/156 jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- runner- vivid-mako/ 641 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- vivid-armhf/ 737 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- vivid-armhf/ 737/artifact/ work/output/ *zip*/output. zip s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 16944
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/ubuntu- system- settings- ci/1886/ rebuild
http://