Merge lp:~canonical-platform-qa/ubuntu-system-tests/system_settings into lp:ubuntu-system-tests

Proposed by Santiago Baldassin
Status: Work in progress
Proposed branch: lp:~canonical-platform-qa/ubuntu-system-tests/system_settings
Merge into: lp:ubuntu-system-tests
Prerequisite: lp:~canonical-platform-qa/ubuntu-system-tests/use_app_helper_phase_one
Diff against target: 797 lines (+218/-176)
22 files modified
ubuntu_system_tests/helpers/application.py (+4/-0)
ubuntu_system_tests/helpers/dialer_app/fixture_setup.py (+10/-7)
ubuntu_system_tests/helpers/messaging/fixture_setup.py (+9/-6)
ubuntu_system_tests/helpers/system_settings/__init__.py (+21/-41)
ubuntu_system_tests/helpers/system_settings/_cpo.py (+2/-1)
ubuntu_system_tests/helpers/system_settings/app.py (+39/-38)
ubuntu_system_tests/helpers/system_settings/fixture_setup.py (+9/-5)
ubuntu_system_tests/helpers/system_settings/gsettings.py (+72/-0)
ubuntu_system_tests/helpers/system_settings/utils.py (+0/-13)
ubuntu_system_tests/helpers/unity8/settings_wizard.py (+0/-11)
ubuntu_system_tests/perftests/app_startup/test_app_startup.py (+2/-2)
ubuntu_system_tests/tests/base_messaging.py (+4/-8)
ubuntu_system_tests/tests/indicators/test_indicator_battery.py (+5/-3)
ubuntu_system_tests/tests/indicators/test_indicator_bluetooth.py (+3/-4)
ubuntu_system_tests/tests/indicators/test_indicator_datetime.py (+3/-4)
ubuntu_system_tests/tests/indicators/test_indicator_network.py (+6/-8)
ubuntu_system_tests/tests/indicators/test_indicator_sound.py (+3/-4)
ubuntu_system_tests/tests/test_about_this_phone.py (+4/-2)
ubuntu_system_tests/tests/test_messaging_sms.py (+3/-4)
ubuntu_system_tests/tests/test_rotation.py (+12/-8)
ubuntu_system_tests/tests/test_settings_wizard.py (+3/-4)
ubuntu_system_tests/tests/test_sim_pin.py (+4/-3)
To merge this branch: bzr merge lp:~canonical-platform-qa/ubuntu-system-tests/system_settings
Reviewer Review Type Date Requested Status
platform-qa-bot continuous-integration Needs Fixing
Sergio Cazzolato Needs Fixing
Richard Huddie (community) Needs Fixing
prod-platform-qa continuous-integration Pending
Review via email: mp+303690@code.launchpad.net

Commit message

Use the application helper for system settings

Description of the change

This mp includes a rewrite of the system settings app to start using the application helper.
Gsettings methods were moved to a separate module and re-written to remove duplicate code and to make it easier to absorb possible changes in the keys or in the schemas
All the tests using the system settings were updated

@run_tests: ubuntu_system_tests.tests.indicators.test_indicator_battery ubuntu_system_tests.tests.indicators.test_indicator_bluetooth ubuntu_system_tests.tests.indicators.test_indicator_datetime ubuntu_system_tests.tests.indicators.test_indicator_network.NetworkIndicatorTestCase ubuntu_system_tests.tests.indicators.test_indicator_sound.SoundIndicatorTestCase ubuntu_system_tests.tests.test_rotation

To post a comment you must log in.
Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Needs Fixing (continuous-integration)
426. By Santiago Baldassin

fixing import error

Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Needs Fixing (continuous-integration)
427. By Santiago Baldassin

restoring scopes.json

Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Needs Fixing (continuous-integration)
428. By Santiago Baldassin

Merge from trunk

Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Sergio Cazzolato (sergio-j-cazzolato) wrote :

I saw this error:

Traceback (most recent call last):
  File "/tmp/adt-run.SsLom4/build.jyX/real-tree/ubuntu_system_tests/tests/indicators/test_indicator_bluetooth.py", line 44, in test_bluetooth_settings_item_open_correct_page
    system_settings.is_settings_page_visible(BLUETOOTH_SETTINGS_PAGE)
AttributeError: 'SystemSettings' object has no attribute 'is_settings_page_visible'
}}}

review: Needs Fixing
429. By Santiago Baldassin

Merge from trunk

430. By Santiago Baldassin

Fixing tests after the merge

Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Sergio Cazzolato (sergio-j-cazzolato) wrote :

Tests passing, minor comments inline

review: Needs Fixing
Revision history for this message
Richard Huddie (rhuddie) wrote :

How does this mp fit with the one we discussed about moving static helpers from the app.py file to the utils.py file? https://code.launchpad.net/~canonical-platform-qa/ubuntu-system-tests/mv-app-helpers-to-utils/+merge/303817

The default sim settings on this mp are also outdated now, as the settings backend has been changed from gsettings to dbus.

review: Needs Fixing
431. By Santiago Baldassin

Merge from trunk

432. By Santiago Baldassin

Refactor after merge from trunk

433. By Santiago Baldassin

Merge from trunk

Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Needs Fixing (continuous-integration)
434. By Santiago Baldassin

More fixes

Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Needs Fixing (continuous-integration)
435. By Santiago Baldassin

restoring scopes.json

Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Sergio Cazzolato (sergio-j-cazzolato) wrote :

minor comments inline

review: Needs Fixing
Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Needs Fixing (continuous-integration)

Unmerged revisions

435. By Santiago Baldassin

restoring scopes.json

434. By Santiago Baldassin

More fixes

433. By Santiago Baldassin

Merge from trunk

432. By Santiago Baldassin

Refactor after merge from trunk

431. By Santiago Baldassin

Merge from trunk

430. By Santiago Baldassin

Fixing tests after the merge

429. By Santiago Baldassin

Merge from trunk

428. By Santiago Baldassin

Merge from trunk

427. By Santiago Baldassin

restoring scopes.json

426. By Santiago Baldassin

fixing import error

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntu_system_tests/helpers/application.py'
2--- ubuntu_system_tests/helpers/application.py 2016-09-07 18:01:26 +0000
3+++ ubuntu_system_tests/helpers/application.py 2016-09-07 18:01:26 +0000
4@@ -99,6 +99,10 @@
5 self.app_process_name = app_process_name
6 super().__init__(app_name, app_click, app_id)
7
8+ @retry(stop_max_attempt_number=5, wait_fixed=1000,
9+ retry_on_exception=lambda exception: isinstance(
10+ exception, ProcessSearchError) or isinstance(
11+ exception, NoSuchProcess))
12 def get_proxy_object(self):
13 if self.proxy_object is None:
14 self.proxy_object = autopilot.get_proxy_object_for_existing_app(
15
16=== modified file 'ubuntu_system_tests/helpers/dialer_app/fixture_setup.py'
17--- ubuntu_system_tests/helpers/dialer_app/fixture_setup.py 2016-07-15 11:15:17 +0000
18+++ ubuntu_system_tests/helpers/dialer_app/fixture_setup.py 2016-09-07 18:01:26 +0000
19@@ -21,8 +21,7 @@
20 import fixtures
21
22 from ubuntu_system_tests.helpers import try_import
23-from ubuntu_system_tests.helpers.system_settings import (
24- get_default_sim_for_calls, set_default_sim_for_calls)
25+from ubuntu_system_tests.helpers.system_settings.gsettings import PhoneSettings
26
27 UseEmptyHistory = try_import('dialer_app.fixture_setup').UseEmptyHistory
28
29@@ -42,18 +41,22 @@
30
31 """
32
33- def __init__(self, sim='1'):
34+ def __init__(self, sim='/ril_1'):
35 """
36 Specify what sim to set.
37
38- :param sim: '1', '2' or 'ask'
39+ :param sim: '/ril_1', '/ril_2' or 'ask'
40
41 """
42 super().__init__()
43 self.sim = sim
44+ self.phone_settings = PhoneSettings()
45
46 def setUp(self):
47 super().setUp()
48- original_value = get_default_sim_for_calls()
49- self.addCleanup(set_default_sim_for_calls, original_value)
50- set_default_sim_for_calls(self.sim)
51+ original_value = self.phone_settings.get(
52+ self.phone_settings.sim_for_calls)
53+ self.addCleanup(self.phone_settings.set,
54+ self.phone_settings.sim_for_calls,
55+ original_value)
56+ self.phone_settings.set(self.phone_settings.sim_for_calls, self.sim)
57
58=== modified file 'ubuntu_system_tests/helpers/messaging/fixture_setup.py'
59--- ubuntu_system_tests/helpers/messaging/fixture_setup.py 2016-07-14 18:42:24 +0000
60+++ ubuntu_system_tests/helpers/messaging/fixture_setup.py 2016-09-07 18:01:26 +0000
61@@ -26,9 +26,9 @@
62
63 from ubuntu_system_tests.helpers import (
64 file_system as fs,
65- system_settings,
66 try_import,
67 )
68+from ubuntu_system_tests.helpers.system_settings.gsettings import PhoneSettings
69
70 fixture_setup = try_import('messaging_app.fixture_setup')
71
72@@ -147,15 +147,18 @@
73 class SetDefaultSIM(fixtures.Fixture):
74 """Fixture to set the default sim for messaging."""
75
76- def __init__(self, sim=system_settings.SIM_1):
77+ def __init__(self, sim='/ril_1'):
78 self.sim = sim
79+ self.phone_settings = PhoneSettings()
80
81 def setUp(self):
82 super().setUp()
83- original_value = system_settings.get_default_sim_for_messages()
84- self.addCleanup(
85- system_settings.set_default_sim_for_messages, original_value)
86- system_settings.set_default_sim_for_messages(self.sim)
87+ original_value = self.phone_settings.get(
88+ self.phone_settings.sim_for_messages)
89+ self.addCleanup(self.phone_settings.set,
90+ self.phone_settings.sim_for_messages,
91+ original_value)
92+ self.phone_settings.set(self.phone_settings.sim_for_messages, self.sim)
93
94
95 class UseEmptySmsHistory(fixture_setup.FillCustomSmsHistory):
96
97=== modified file 'ubuntu_system_tests/helpers/system_settings/__init__.py'
98--- ubuntu_system_tests/helpers/system_settings/__init__.py 2016-08-24 13:47:25 +0000
99+++ ubuntu_system_tests/helpers/system_settings/__init__.py 2016-09-07 18:01:26 +0000
100@@ -19,56 +19,36 @@
101 #
102
103 from ubuntu_system_tests.helpers.system_settings.app import (
104- APP,
105- APP_NAME,
106- APP_WIN_ID,
107- get_system_settings_proxy,
108- is_system_settings_running,
109- launch_system_settings,
110+ SystemSettings
111 )
112 from ubuntu_system_tests.helpers.system_settings.utils import (
113- ensure_power_settings_page_visible,
114- ensure_settings_page_visible,
115- get_default_sim_for_calls,
116+ get_ril_modem_for_sim,
117 get_default_sim_for_messages,
118- get_ril_modem_for_sim,
119- get_rotation_lock,
120- get_silent_mode,
121- is_reporting_enabled,
122- set_default_modem_for_calls,
123+ set_default_sim_for_messages,
124 set_default_modem_for_messages,
125+ get_default_sim_for_calls,
126 set_default_sim_for_calls,
127- set_default_sim_for_messages,
128+ set_default_modem_for_calls,
129+ get_rotation_lock,
130 set_rotation_lock,
131+ get_silent_mode,
132 set_silent_mode,
133- SIM_1,
134- SIM_2,
135- SIM_ASK,
136+ is_reporting_enabled
137 )
138
139
140 __all__ = [
141- 'APP',
142- 'APP_NAME',
143- 'APP_WIN_ID',
144- 'ensure_power_settings_page_visible',
145- 'ensure_settings_page_visible',
146- 'get_default_sim_for_calls',
147- 'get_default_sim_for_messages',
148- 'get_ril_modem_for_sim',
149- 'get_rotation_lock',
150- 'get_silent_mode',
151- 'get_system_settings_proxy',
152- 'is_reporting_enabled',
153- 'is_system_settings_running',
154- 'launch_system_settings',
155- 'set_default_modem_for_calls',
156- 'set_default_modem_for_messages',
157- 'set_default_sim_for_calls',
158- 'set_default_sim_for_messages',
159- 'set_rotation_lock',
160- 'set_silent_mode',
161- 'SIM_1',
162- 'SIM_2',
163- 'SIM_ASK',
164+ "SystemSettings",
165+ "get_ril_modem_for_sim",
166+ "get_default_sim_for_messages",
167+ "set_default_sim_for_messages",
168+ "set_default_modem_for_messages",
169+ "get_default_sim_for_calls",
170+ "set_default_sim_for_calls",
171+ "set_default_modem_for_calls",
172+ "get_rotation_lock",
173+ "set_rotation_lock",
174+ "get_silent_mode",
175+ "set_silent_mode",
176+ "is_reporting_enabled"
177 ]
178
179=== modified file 'ubuntu_system_tests/helpers/system_settings/_cpo.py'
180--- ubuntu_system_tests/helpers/system_settings/_cpo.py 2016-08-31 09:43:05 +0000
181+++ ubuntu_system_tests/helpers/system_settings/_cpo.py 2016-09-07 18:01:26 +0000
182@@ -144,7 +144,8 @@
183 text='Bluetooth address').value
184
185 def _get_storage(self):
186- return self.wait_select_single('SingleValue', objectName='storageItem')
187+ return self.wait_select_single('SingleValueProgression',
188+ objectName='storageItem')
189
190 def get_storage(self):
191 """ Retrieve the storage item value """
192
193=== modified file 'ubuntu_system_tests/helpers/system_settings/app.py'
194--- ubuntu_system_tests/helpers/system_settings/app.py 2016-09-05 09:58:14 +0000
195+++ ubuntu_system_tests/helpers/system_settings/app.py 2016-09-07 18:01:26 +0000
196@@ -17,42 +17,43 @@
197 # You should have received a copy of the GNU General Public License
198 # along with this program. If not, see <http://www.gnu.org/licenses/>.
199 #
200-
201-
202-from ubuntu_system_tests.helpers import autopilot
203-from ubuntu_system_tests.helpers import processes
204-from ubuntu_system_tests.helpers.scopes.apps import (
205- launch_application_from_apps_scope
206-)
207-
208-APP = 'system-settings'
209+import configparser
210+import os
211+
212+from ubuntu_system_tests.helpers.application import QmlApplication
213+
214 APP_NAME = 'System Settings'
215-APP_WIN_ID = 'ubuntu-system-settings'
216-
217-
218-def launch_system_settings():
219- """
220- Launch system settings from apps scope and return proxy object.
221-
222- :return: Proxy object for system settings.
223-
224- """
225- launch_application_from_apps_scope(APP_NAME)
226- return get_system_settings_proxy()
227-
228-
229-def is_system_settings_running():
230- """ Indicate if the system settings is currently running """
231- return processes.is_process_running(APP)
232-
233-
234-def get_system_settings_proxy():
235- """
236- Return system settings proxy object from existing process.
237-
238- :return: Proxy object for system settings.
239-
240- """
241- from ubuntu_system_tests.helpers.system_settings import _cpo # NOQA
242- proxy = autopilot.get_proxy_object_for_existing_app(APP)
243- return proxy.main_view
244+APP_ID = 'com.ubuntu.system_settings'
245+APP_QML_FILE = 'system-settings'
246+APP_CLICK = 'com.ubuntu.system.settings'
247+
248+
249+class SystemSettings(QmlApplication):
250+
251+ def __init__(self):
252+ super().__init__(APP_NAME, APP_CLICK, APP_QML_FILE, APP_ID)
253+
254+ def get_main_view(self):
255+ from ubuntu_system_tests.helpers.system_settings import _cpo # NOQA
256+ return self.get_proxy_object().select_single('MainWindow')
257+
258+ def is_settings_page_visible(self, page_object_name):
259+ """Wait until the requested settings page is visible."""
260+ page = self.get_proxy_object().wait_select_single(
261+ objectName=page_object_name)
262+ return page.active and page.visible
263+
264+ def is_page_component_visible(self, page_title):
265+ """Wait until the requested settings page is visible."""
266+ page = self.get_proxy_object().wait_select_single("PageComponent",
267+ title=page_title)
268+ return page.active and page.visible
269+
270+ @staticmethod
271+ def is_reporting_enabled():
272+ """ Detect if the reporting is enabled """
273+ file = os.path.join('/', 'etc', 'writable', 'whoopsie')
274+ config = configparser.ConfigParser()
275+ config.read(file)
276+ return True if config.options(
277+ 'General')['report_metrics'] == 'true' else False
278
279=== modified file 'ubuntu_system_tests/helpers/system_settings/fixture_setup.py'
280--- ubuntu_system_tests/helpers/system_settings/fixture_setup.py 2015-09-21 16:53:14 +0000
281+++ ubuntu_system_tests/helpers/system_settings/fixture_setup.py 2016-09-07 18:01:26 +0000
282@@ -19,8 +19,7 @@
283 #
284 import fixtures
285
286-from ubuntu_system_tests.helpers.system_settings import (
287- get_silent_mode, set_silent_mode)
288+from ubuntu_system_tests.helpers.system_settings.gsettings import SoundSettings
289
290
291 class SilentMode(fixtures.Fixture):
292@@ -33,10 +32,15 @@
293 def __init__(self, enable):
294 super().__init__()
295 self.enable = enable
296+ self.sound_settings = SoundSettings()
297
298 def setUp(self):
299 super().setUp()
300- original_state = get_silent_mode()
301- self.addCleanup(set_silent_mode, original_state)
302+ original_state = self.sound_settings.get(
303+ self.sound_settings.silent_mode)
304+ self.addCleanup(self.sound_settings.set,
305+ self.sound_settings.silent_mode,
306+ original_state)
307 if self.enable != original_state:
308- set_silent_mode(self.enable)
309+ self.sound_settings.set(self.sound_settings.silent_mode,
310+ str(self.enable).lower())
311
312=== added file 'ubuntu_system_tests/helpers/system_settings/gsettings.py'
313--- ubuntu_system_tests/helpers/system_settings/gsettings.py 1970-01-01 00:00:00 +0000
314+++ ubuntu_system_tests/helpers/system_settings/gsettings.py 2016-09-07 18:01:26 +0000
315@@ -0,0 +1,72 @@
316+# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
317+
318+#
319+# Ubuntu System Tests
320+# Copyright (C) 2016 Canonical
321+#
322+# This program is free software: you can redistribute it and/or modify
323+# it under the terms of the GNU General Public License as published by
324+# the Free Software Foundation, either version 3 of the License, or
325+# (at your option) any later version.
326+#
327+# This program is distributed in the hope that it will be useful,
328+# but WITHOUT ANY WARRANTY; without even the implied warranty of
329+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
330+# GNU General Public License for more details.
331+#
332+# You should have received a copy of the GNU General Public License
333+# along with this program. If not, see <http://www.gnu.org/licenses/>.
334+#
335+from subprocess import check_output
336+
337+
338+class GSettings:
339+ def __init__(self, schema):
340+ self.schema = schema
341+ self.name = 'gsettings'
342+
343+ def get(self, key):
344+ return check_output(
345+ [self.name, 'get', self.schema, key],
346+ universal_newlines=True).strip().strip("'")
347+
348+ def set(self, key, value):
349+ return check_output(
350+ [self.name, 'set', self.schema, key, value],
351+ universal_newlines=True)
352+
353+
354+class PhoneSettings(GSettings):
355+ def __init__(self):
356+ self.schema = 'com.ubuntu.phone'
357+ super().__init__(self.schema)
358+
359+ @property
360+ def sim_for_messages(self):
361+ return 'default-sim-for-messages'
362+
363+ @property
364+ def sim_for_calls(self):
365+ return 'default-sim-for-calls'
366+
367+
368+class TouchSystemSettings(GSettings):
369+
370+ def __init__(self):
371+ self.schema = 'com.ubuntu.touch.system'
372+ super().__init__(self.schema)
373+
374+ @property
375+ def rotation_lock(self):
376+ return 'rotation-lock'
377+
378+
379+class SoundSettings(GSettings):
380+
381+ def __init__(self):
382+ self.schema = 'com.ubuntu.touch.sound'
383+ super().__init__(self.schema)
384+
385+ @property
386+ def silent_mode(self):
387+ return 'silent-mode'
388
389=== modified file 'ubuntu_system_tests/helpers/system_settings/utils.py'
390--- ubuntu_system_tests/helpers/system_settings/utils.py 2016-08-24 13:47:25 +0000
391+++ ubuntu_system_tests/helpers/system_settings/utils.py 2016-09-07 18:01:26 +0000
392@@ -155,19 +155,6 @@
393 return _set_phone_property(PROPERTY_DEFAULT_SIM_CALLS, modem)
394
395
396-def ensure_settings_page_visible(settings_app_proxy, page_object_name):
397- """Wait until the requested settings page is visible."""
398- page = settings_app_proxy.wait_select_single(objectName=page_object_name)
399- page.active.wait_for(True)
400-
401-
402-def ensure_power_settings_page_visible(settings_app_proxy):
403- """Wait until battery settings page is visible."""
404- page = settings_app_proxy.wait_select_single('PageComponent',
405- title='Battery')
406- page.active.wait_for(True)
407-
408-
409 def get_rotation_lock():
410 """Return current value for rotation lock."""
411 return check_output(
412
413=== modified file 'ubuntu_system_tests/helpers/unity8/settings_wizard.py'
414--- ubuntu_system_tests/helpers/unity8/settings_wizard.py 2016-08-30 10:38:08 +0000
415+++ ubuntu_system_tests/helpers/unity8/settings_wizard.py 2016-09-07 18:01:26 +0000
416@@ -24,9 +24,6 @@
417 from ubuntuuitoolkit import UbuntuUIToolkitCustomProxyObjectBase
418
419 from ubuntu_system_tests.helpers.autopilot import validate_dbus_object
420-from ubuntu_system_tests.helpers.system_settings import (
421- is_reporting_enabled,
422-)
423 from ubuntu_system_tests.helpers.unity8 import UNITY8_PATH_ROOT
424
425 logger = logging.getLogger(__name__)
426@@ -475,14 +472,6 @@
427 self.pointing_device.click_object(self._get_back_button())
428 return get_wizard(self).get_wifi_connect_page()
429
430- @autopilot.logging.log_action(logger.info)
431- def continue_(self):
432- self.pointing_device.click_object(self._get_continue_button())
433- if is_reporting_enabled():
434- return get_wizard(self).get_reporting_page()
435- else:
436- return get_wizard(self).get_finished_page()
437-
438
439 class ReportingPage(UbuntuUIToolkitCustomProxyObjectBase):
440 """Helper class to interact with the reporting page"""
441
442=== modified file 'ubuntu_system_tests/perftests/app_startup/test_app_startup.py'
443--- ubuntu_system_tests/perftests/app_startup/test_app_startup.py 2016-08-03 13:38:18 +0000
444+++ ubuntu_system_tests/perftests/app_startup/test_app_startup.py 2016-09-07 18:01:26 +0000
445@@ -43,9 +43,9 @@
446 SetLocationAccessRequests)
447 from ubuntu_system_tests.helpers import music
448 from ubuntu_system_tests.helpers import messaging
449-from ubuntu_system_tests.helpers import system_settings
450 from ubuntu_system_tests.helpers import timer
451 from ubuntu_system_tests.helpers import unity8
452+from ubuntu_system_tests.helpers.system_settings import SystemSettings
453 from ubuntu_system_tests.helpers.webapp import ebay, here
454 from ubuntu_system_tests.helpers import webbrowser
455 from ubuntu_system_tests.helpers.webbrowser.fixture_setup import (
456@@ -143,7 +143,7 @@
457
458 def test_system_settings_startup(self):
459 self._run_test('system_settings',
460- system_settings.launch_system_settings,
461+ SystemSettings().launch_from_scope(),
462 unity8.close_all_apps,
463 loaded_method=self.unity_proxy.ensure_app_loaded)
464
465
466=== modified file 'ubuntu_system_tests/tests/base_messaging.py'
467--- ubuntu_system_tests/tests/base_messaging.py 2016-08-03 09:32:27 +0000
468+++ ubuntu_system_tests/tests/base_messaging.py 2016-09-07 18:01:26 +0000
469@@ -36,8 +36,8 @@
470 from ubuntu_system_tests.helpers.messaging import fixture_setup
471 from ubuntu_system_tests.helpers import messaging as messaging_helpers
472 from ubuntu_system_tests.helpers import processes
473-from ubuntu_system_tests.helpers import system_settings
474 from ubuntu_system_tests.helpers import wait_until
475+from ubuntu_system_tests.helpers.system_settings import SystemSettings
476 from ubuntu_system_tests.tests.base_telephony import BaseTelephonyTestCase
477
478 CONTACT_NAME_1 = 'Fulano de Tal'
479@@ -554,18 +554,14 @@
480 :param value: Value to set: 'ask', '1' or '2' (sim slot)
481
482 """
483- settings = system_settings.launch_system_settings()
484+ system_settings = SystemSettings()
485+ system_settings.launch_from_scope()
486+ settings = system_settings.get_main_view()
487 cellular = settings.go_to_cellular_page()
488-
489- if value is '1' or value is '2':
490- # convert to ril index, ril_0 or ril_1
491- value = system_settings.get_ril_modem_for_sim(value)
492 selector = cellular.get_default_sim_for_messages_selector(value)
493 settings.scroll_to_and_click(selector)
494 selector.selected.wait_for(True)
495 self.dash.swipe_screen_from_left()
496- self.addCleanup(processes.ensure_application_closed,
497- system_settings.APP)
498
499 def click_message_url(self, message_text):
500 """Click the message text in a message bubble."""
501
502=== modified file 'ubuntu_system_tests/tests/indicators/test_indicator_battery.py'
503--- ubuntu_system_tests/tests/indicators/test_indicator_battery.py 2016-08-29 17:23:35 +0000
504+++ ubuntu_system_tests/tests/indicators/test_indicator_battery.py 2016-09-07 18:01:26 +0000
505@@ -19,10 +19,12 @@
506 #
507
508 from ubuntu_system_tests.helpers.indicators.battery import BatteryIndicatorPage
509-from ubuntu_system_tests.helpers import system_settings
510 from ubuntu_system_tests.helpers.indicators.indicators import IndicatorsFactory
511+from ubuntu_system_tests.helpers.system_settings import SystemSettings
512 from ubuntu_system_tests.tests import base
513
514+BATTERY_SETTINGS_PAGE = 'batteryPage'
515+
516
517 class BatteryIndicatorTestCase(base.BaseUbuntuSystemTestCase):
518
519@@ -40,5 +42,5 @@
520 3. Ensure battery settings open.
521 """
522 self.indicator_page.open_battery_settings()
523- settings_app = system_settings.get_system_settings_proxy()
524- system_settings.ensure_power_settings_page_visible(settings_app)
525+ system_settings = SystemSettings()
526+ system_settings.is_page_component_visible("Battery")
527
528=== modified file 'ubuntu_system_tests/tests/indicators/test_indicator_bluetooth.py'
529--- ubuntu_system_tests/tests/indicators/test_indicator_bluetooth.py 2016-08-29 17:23:35 +0000
530+++ ubuntu_system_tests/tests/indicators/test_indicator_bluetooth.py 2016-09-07 18:01:26 +0000
531@@ -18,10 +18,10 @@
532 # along with this program. If not, see <http://www.gnu.org/licenses/>.
533 #
534
535-from ubuntu_system_tests.helpers import system_settings
536 from ubuntu_system_tests.helpers.indicators.bluetooth import (
537 BluetoothIndicatorPage)
538 from ubuntu_system_tests.helpers.indicators.indicators import IndicatorsFactory
539+from ubuntu_system_tests.helpers.system_settings import SystemSettings
540
541 from ubuntu_system_tests.tests import base
542
543@@ -45,6 +45,5 @@
544 3. Ensure bluetooth settings open
545 """
546 self.bluetooth_indicator.open_bluetooth_settings()
547- settings_app = system_settings.get_system_settings_proxy()
548- system_settings.ensure_settings_page_visible(settings_app,
549- BLUETOOTH_SETTINGS_PAGE)
550+ system_settings = SystemSettings()
551+ system_settings.is_settings_page_visible(BLUETOOTH_SETTINGS_PAGE)
552
553=== modified file 'ubuntu_system_tests/tests/indicators/test_indicator_datetime.py'
554--- ubuntu_system_tests/tests/indicators/test_indicator_datetime.py 2016-08-29 17:23:35 +0000
555+++ ubuntu_system_tests/tests/indicators/test_indicator_datetime.py 2016-09-07 18:01:26 +0000
556@@ -18,10 +18,10 @@
557 # along with this program. If not, see <http://www.gnu.org/licenses/>.
558 #
559
560-from ubuntu_system_tests.helpers import system_settings
561 from ubuntu_system_tests.helpers.indicators.datetime import (
562 DateTimeIndicatorPage)
563 from ubuntu_system_tests.helpers.indicators.indicators import IndicatorsFactory
564+from ubuntu_system_tests.helpers.system_settings import SystemSettings
565
566 from ubuntu_system_tests.tests import base
567
568@@ -45,6 +45,5 @@
569 3. Ensure date time settings open.
570 """
571 self.indicator_page.open_date_time_settings()
572- settings_app = system_settings.get_system_settings_proxy()
573- system_settings.ensure_settings_page_visible(settings_app,
574- DATETIME_SETTINGS_PAGE)
575+ system_settings = SystemSettings()
576+ system_settings.is_settings_page_visible(DATETIME_SETTINGS_PAGE)
577
578=== modified file 'ubuntu_system_tests/tests/indicators/test_indicator_network.py'
579--- ubuntu_system_tests/tests/indicators/test_indicator_network.py 2016-08-30 20:04:45 +0000
580+++ ubuntu_system_tests/tests/indicators/test_indicator_network.py 2016-09-07 18:01:26 +0000
581@@ -32,7 +32,7 @@
582 from ubuntu_system_tests.helpers.platform import is_wifi_supported
583 from ubuntu_system_tests.helpers.ofono import (
584 fixture_setup, wait_for_all_sims_registered)
585-from ubuntu_system_tests.helpers import system_settings
586+from ubuntu_system_tests.helpers.system_settings import SystemSettings
587 from ubuntu_system_tests.tests import base
588
589
590@@ -55,7 +55,7 @@
591 @skipUnless(ofono.is_sim_inserted() and is_wifi_supported(),
592 'SIM and Wi-Fi support required.')
593 def setUp(self, allow_scopes_location=True, restart_unity=True,
594- fake_sensors=False):
595+ fake_sensors=True):
596 self.assertTrue(wait_for_all_sims_registered())
597 self.radio_killswitch = self.useFixture(
598 radio_killswitch.RadioKillswitch(False))
599@@ -176,9 +176,8 @@
600 3. Ensure cellular settings open
601 """
602 self.indicator_page.open_cellular_settings()
603- settings_app = system_settings.get_system_settings_proxy()
604- system_settings.ensure_settings_page_visible(settings_app,
605- CELLULAR_SETTINGS_PAGE)
606+ system_settings = SystemSettings()
607+ system_settings.is_settings_page_visible(CELLULAR_SETTINGS_PAGE)
608
609 def test_wifi_settings_item_open_correct_page(self):
610 """
611@@ -187,6 +186,5 @@
612 3. Ensure Wifi settings open
613 """
614 self.indicator_page.open_wifi_settings()
615- settings_app = system_settings.get_system_settings_proxy()
616- system_settings.ensure_settings_page_visible(settings_app,
617- WIFI_SETTINGS_PAGE)
618+ system_settings = SystemSettings()
619+ system_settings.is_settings_page_visible(WIFI_SETTINGS_PAGE)
620
621=== modified file 'ubuntu_system_tests/tests/indicators/test_indicator_sound.py'
622--- ubuntu_system_tests/tests/indicators/test_indicator_sound.py 2016-09-05 11:22:39 +0000
623+++ ubuntu_system_tests/tests/indicators/test_indicator_sound.py 2016-09-07 18:01:26 +0000
624@@ -26,10 +26,10 @@
625
626 from ubuntu_system_tests.helpers import media
627 from ubuntu_system_tests.helpers import music
628-from ubuntu_system_tests.helpers import system_settings
629 from ubuntu_system_tests.helpers.indicators.indicators import IndicatorsFactory
630 from ubuntu_system_tests.helpers.music import fixture_setup as music_fixture
631 from ubuntu_system_tests.helpers import unity8
632+from ubuntu_system_tests.helpers.system_settings import SystemSettings
633
634 from ubuntu_system_tests.tests import base
635 from ubuntu_system_tests.tests import data as test_data
636@@ -54,9 +54,8 @@
637 3. Ensure sound settings open
638 """
639 self.indicator_page.open_sound_settings()
640- settings_app = system_settings.get_system_settings_proxy()
641- system_settings.ensure_settings_page_visible(settings_app,
642- SOUND_SETTINGS_PAGE)
643+ system_settings = SystemSettings()
644+ system_settings.is_settings_page_visible(SOUND_SETTINGS_PAGE)
645
646
647 class SoundIndicatorWithMprisControlsTestCase(base.BaseUbuntuSystemTestCase):
648
649=== modified file 'ubuntu_system_tests/tests/test_about_this_phone.py'
650--- ubuntu_system_tests/tests/test_about_this_phone.py 2016-07-05 18:59:58 +0000
651+++ ubuntu_system_tests/tests/test_about_this_phone.py 2016-09-07 18:01:26 +0000
652@@ -24,7 +24,7 @@
653 from ubuntu_system_tests.helpers import gallery
654 from ubuntu_system_tests.helpers import ofono
655 from ubuntu_system_tests.helpers import platform
656-from ubuntu_system_tests.helpers import system_settings
657+from ubuntu_system_tests.helpers.system_settings import SystemSettings
658
659 from ubuntu_system_tests.tests import base
660
661@@ -33,7 +33,9 @@
662
663 def setUp(self):
664 super().setUp()
665- ss_app = system_settings.launch_system_settings()
666+ system_settings = SystemSettings()
667+ system_settings.launch_from_scope()
668+ ss_app = system_settings.get_main_view()
669 self.about_page = ss_app.go_to_about_page()
670
671 def test_check_device_name(self):
672
673=== modified file 'ubuntu_system_tests/tests/test_messaging_sms.py'
674--- ubuntu_system_tests/tests/test_messaging_sms.py 2016-08-03 09:32:27 +0000
675+++ ubuntu_system_tests/tests/test_messaging_sms.py 2016-09-07 18:01:26 +0000
676@@ -37,7 +37,6 @@
677 fixture_setup as network_fixture
678 )
679 from ubuntu_system_tests.helpers import ofono
680-from ubuntu_system_tests.helpers.system_settings import SIM_1, SIM_ASK
681 from ubuntu_system_tests.helpers.uid import b64_uuid
682 from ubuntu_system_tests.helpers import webbrowser
683
684@@ -334,7 +333,7 @@
685
686 """
687 self.useFixture(messaging_fixture.SetDualSIMPromptConfig())
688- self.set_default_sim_for_messages_with_uss(SIM_ASK)
689+ self.set_default_sim_for_messages_with_uss('ask')
690 self.launch_messaging()
691 message = Message(body=b64_uuid())
692 recipients = [self.contact_1]
693@@ -356,13 +355,13 @@
694
695 """
696 self.useFixture(messaging_fixture.SetDualSIMPromptConfig())
697- self.set_default_sim_for_messages_with_uss(SIM_1)
698+ self.set_default_sim_for_messages_with_uss('/ril_0')
699
700 self.launch_messaging()
701 message = Message(body=b64_uuid())
702 recipients = [self.contact_1]
703 self.send_message_to_contacts_and_validate_replies(
704- recipients, message, expected_default_sim=SIM_1)
705+ recipients, message, expected_default_sim='/ril_0')
706
707 def test_send_sms_to_contact(self):
708 """
709
710=== modified file 'ubuntu_system_tests/tests/test_rotation.py'
711--- ubuntu_system_tests/tests/test_rotation.py 2016-07-25 19:39:31 +0000
712+++ ubuntu_system_tests/tests/test_rotation.py 2016-09-07 18:01:26 +0000
713@@ -19,11 +19,9 @@
714 #
715
716 from ubuntu_system_tests.helpers import sensors
717-from ubuntu_system_tests.helpers.system_settings import (
718- launch_system_settings,
719- get_rotation_lock,
720- set_rotation_lock,
721-)
722+from ubuntu_system_tests.helpers.system_settings import SystemSettings
723+from ubuntu_system_tests.helpers.system_settings.gsettings import (
724+ TouchSystemSettings)
725 from ubuntu_system_tests.tests import base
726 from autopilot.matchers import Eventually
727 from testtools.matchers import Equals
728@@ -38,10 +36,16 @@
729
730 def setUp(self):
731 super().setUp(fake_sensors=True)
732- self.addCleanup(set_rotation_lock, get_rotation_lock())
733- set_rotation_lock('false')
734+ self.touch_settings = TouchSystemSettings()
735+ self.system_settings = SystemSettings()
736+ rotation_lock = self.touch_settings.rotation_lock
737+ self.addCleanup(self.touch_settings.set,
738+ rotation_lock,
739+ self.touch_settings.get(rotation_lock))
740+ self.touch_settings.set(rotation_lock, 'false')
741 sensors.set_orientation_top_up()
742- self.main_view = launch_system_settings()
743+ self.system_settings.launch_from_scope()
744+ self.main_view = self.system_settings.get_main_view()
745 self.unity_proxy.ensure_app_loaded()
746 self.shell_view = self.shell.select_single('Shell')
747
748
749=== modified file 'ubuntu_system_tests/tests/test_settings_wizard.py'
750--- ubuntu_system_tests/tests/test_settings_wizard.py 2016-07-07 09:03:17 +0000
751+++ ubuntu_system_tests/tests/test_settings_wizard.py 2016-09-07 18:01:26 +0000
752@@ -22,9 +22,8 @@
753 is_agps_supported, is_wifi_supported
754 )
755 from ubuntu_system_tests.helpers import testbed
756-from ubuntu_system_tests.helpers.system_settings import (
757- is_reporting_enabled,
758-)
759+from ubuntu_system_tests.helpers.system_settings import SystemSettings
760+
761 from ubuntu_system_tests.helpers.unity8.fixture_setup import SettingsWizard
762
763 from ubuntu_system_tests.tests import base
764@@ -182,7 +181,7 @@
765 self.config[KEY_WIFI_SSID],
766 self.config[KEY_WIFI_PASSWORD])
767
768- if is_reporting_enabled():
769+ if SystemSettings().is_reporting_enabled():
770 # Validate the reporting page when it is part of the wizard
771 reporting_page = self._test_location_support(
772 location_supported, next_page)
773
774=== modified file 'ubuntu_system_tests/tests/test_sim_pin.py'
775--- ubuntu_system_tests/tests/test_sim_pin.py 2016-07-05 18:59:58 +0000
776+++ ubuntu_system_tests/tests/test_sim_pin.py 2016-09-07 18:01:26 +0000
777@@ -25,7 +25,7 @@
778
779 from ubuntu_system_tests.helpers import ofono
780 from ubuntu_system_tests.helpers.ofono import fixture_setup as ofono_fixture
781-from ubuntu_system_tests.helpers import system_settings
782+from ubuntu_system_tests.helpers.system_settings import SystemSettings
783 from ubuntu_system_tests.tests import base
784
785
786@@ -36,8 +36,9 @@
787 def setUp(self):
788 super(SimPinTestCase, self).setUp()
789 self.useFixture(ofono_fixture.UnlockSims())
790- self.app = system_settings.launch_system_settings()
791-
792+ system_settings = SystemSettings()
793+ system_settings.launch_from_scope()
794+ self.app = system_settings.get_main_view()
795 # As per this bug where we're unable to launch the browser from the
796 # scope after a unity8 reboot.
797 # https://bugs.launchpad.net/ubuntu/+source/unity8/+bug/1401361

Subscribers

People subscribed via source and target branches

to all changes: