Merge lp:~sbaldassin/ubuntu-system-tests/indicators_tests into lp:ubuntu-system-tests

Proposed by Santiago Baldassin
Status: Merged
Approved by: Richard Huddie
Approved revision: 524
Merged at revision: 519
Proposed branch: lp:~sbaldassin/ubuntu-system-tests/indicators_tests
Merge into: lp:ubuntu-system-tests
Diff against target: 547 lines (+99/-228)
12 files modified
ubuntu_system_tests/helpers/indicators/cpo.py (+1/-1)
ubuntu_system_tests/helpers/indicators/datetime.py (+1/-0)
ubuntu_system_tests/helpers/indicators/indicators.py (+25/-12)
ubuntu_system_tests/helpers/indicators/network/cpo.py (+15/-9)
ubuntu_system_tests/helpers/music/__init__.py (+3/-9)
ubuntu_system_tests/helpers/music/app.py (+23/-37)
ubuntu_system_tests/helpers/ofono/utils.py (+8/-5)
ubuntu_system_tests/tests/base.py (+1/-2)
ubuntu_system_tests/tests/indicators/base.py (+2/-3)
ubuntu_system_tests/tests/indicators/test_indicator_bluetooth.py (+0/-4)
ubuntu_system_tests/tests/indicators/test_indicator_network.py (+9/-143)
ubuntu_system_tests/tests/indicators/test_indicator_sound.py (+11/-3)
To merge this branch: bzr merge lp:~sbaldassin/ubuntu-system-tests/indicators_tests
Reviewer Review Type Date Requested Status
Richard Huddie (community) Approve
platform-qa-bot continuous-integration Approve
Review via email: mp+320445@code.launchpad.net

Commit message

Indicators test cases

Description of the change

This mp update the system tests helpers to run the indicator test cases

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

To post a comment you must log in.
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)
517. By Santiago Baldassin

Updating the rest of the indicators test cases

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)
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: Approve (continuous-integration)
Revision history for this message
Richard Huddie (rhuddie) wrote :

Although the tests are passing, I'm seeing this import error during the test log: http://pastebin.ubuntu.com/24223453/

I think other thing to consider is where tests have been changed to be ethernet specific. On real hardware where wifi is supported (e.g. dragonboard), the ethernet indicator would be replaced by the wifi indicator. So can we make the tests more generic? e.g. test_ethernet_settings_item_open_correct_page changes to test_network_settings_item_open_correct_page, and then open the relevant indicator based on whether wifi of ethernet is supported.

Some other comments below.

review: Needs Fixing
Revision history for this message
Santiago Baldassin (sbaldassin) wrote :

Thanks for the feedback Richard.
Completely agree with the comment about making the tests more generic.
Replies inline

518. By Santiago Baldassin

Addressing comments from the reviews

519. By Santiago Baldassin

Merge from trunk

520. By Santiago Baldassin

Fixing flake8 issues

521. By Santiago Baldassin

Removing import error

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

Fixing flake8

Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Richard Huddie (rhuddie) wrote :

see reply below

523. By Santiago Baldassin

Addressing comments from the reviews

Revision history for this message
Santiago Baldassin (sbaldassin) wrote :

Comment addressed

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

Fixing flake8 issues

Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Richard Huddie (rhuddie) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntu_system_tests/helpers/indicators/cpo.py'
2--- ubuntu_system_tests/helpers/indicators/cpo.py 2016-12-02 12:16:41 +0000
3+++ ubuntu_system_tests/helpers/indicators/cpo.py 2017-03-30 19:25:29 +0000
4@@ -20,7 +20,7 @@
5 from ubuntu_system_tests.helpers.ubuntuuitools.cpo.qquicklistview import QQuickListView # NOQA
6 from ubuntu_system_tests.helpers.ubuntuuitools.cpo.common import CustomProxyObjectBase # NOQA
7
8-INDICATOR_PAGE_PATH = b'IndicatorPage'
9+INDICATOR_PAGE_PATH = b'PanelMenuPage'
10
11
12 class IndicatorPage(CustomProxyObjectBase):
13
14=== modified file 'ubuntu_system_tests/helpers/indicators/datetime.py'
15--- ubuntu_system_tests/helpers/indicators/datetime.py 2016-12-19 18:50:17 +0000
16+++ ubuntu_system_tests/helpers/indicators/datetime.py 2017-03-30 19:25:29 +0000
17@@ -27,6 +27,7 @@
18 """Autopilot helper for the date time indicator page."""
19
20 name = 'indicator-datetime'
21+ title = 'Time & Date'
22
23 @classmethod
24 def validate_dbus_object(cls, path, state):
25
26=== modified file 'ubuntu_system_tests/helpers/indicators/indicators.py'
27--- ubuntu_system_tests/helpers/indicators/indicators.py 2016-12-19 18:50:17 +0000
28+++ ubuntu_system_tests/helpers/indicators/indicators.py 2017-03-30 19:25:29 +0000
29@@ -16,9 +16,8 @@
30 # You should have received a copy of the GNU General Public License
31 # along with this program. If not, see <http://www.gnu.org/licenses/>.
32
33+from autopilot.exceptions import StateNotFoundError
34 from ubuntu_system_tests.helpers import context
35-from autopilot import input
36-
37 from ubuntu_system_tests.helpers.input_manager import input_manager
38
39 TRANSFER_INDICATOR = 'indicator-transfer'
40@@ -27,16 +26,30 @@
41 class IndicatorsFactory:
42
43 @staticmethod
44- def get_indicators_page(indicator_name):
45- widget = context.shared.unity.main_window._get_indicator_panel_item(
46- indicator_name)
47- start_x, start_y = input.get_center_point(widget)
48- end_x = start_x
49- end_y = context.shared.unity.main_window.height
50+ def get_indicators_page(name):
51+ date_time_indicator = context.shared.unity.main_window.select_single(
52+ objectName='indicator-datetime-panelItem')
53+ x, y, w, h = date_time_indicator.get_properties()['globalRect']
54+
55 input_manager.pointer.drag(
56- start_x, start_y, end_x, end_y)
57- context.shared.unity.main_window.wait_select_single(
58- 'IndicatorsMenu', fullyOpened=True)
59+ x + w / 2, y + h / 2, x + w / 2,
60+ context.shared.unity.main_window.get_properties()['height'] / 2)
61+
62+ indicators_list = context.shared.unity.main_window.wait_select_single(
63+ objectName='indicatorsContentListView', visible=True, enabled=True)
64+
65+ while not indicators_list.get_properties()['atXBeginning']:
66+ input_manager.keyboard.press_and_release('LEFT')
67+
68+ while not indicators_list.get_properties()['atXEnd']:
69+ try:
70+ indicators_list.select_single(
71+ objectName='{}-page'.format(name),
72+ visible=True,
73+ enabled=True)
74+ break
75+ except StateNotFoundError:
76+ input_manager.keyboard.press_and_release('RIGHT')
77
78 return context.shared.unity.main_window.select_single(
79- 'IndicatorPage', visible=True)
80+ 'PanelMenuPage', visible=True)
81
82=== modified file 'ubuntu_system_tests/helpers/indicators/network/cpo.py'
83--- ubuntu_system_tests/helpers/indicators/network/cpo.py 2017-01-16 12:41:26 +0000
84+++ ubuntu_system_tests/helpers/indicators/network/cpo.py 2017-03-30 19:25:29 +0000
85@@ -16,7 +16,7 @@
86 # You should have received a copy of the GNU General Public License
87 # along with this program. If not, see <http://www.gnu.org/licenses/>.
88 #
89-
90+from ubuntu_system_tests.helpers import platform
91 from ubuntu_system_tests.helpers.indicators.cpo import (
92 IndicatorPage, INDICATOR_PAGE_PATH)
93 from ubuntu_system_tests.helpers.autopilot import validate_dbus_object
94@@ -86,18 +86,24 @@
95 if self.is_wifi_enabled():
96 self._get_wifi_switch().toggle()
97
98- def _get_cellular_settings_menu_item(self):
99+ def _get_ethernet_settings_menu_item(self):
100 """Return the menu item which opens cellular settings."""
101 return self.select_single(
102- objectName='indicator.cellular.settings', visible=True)
103-
104- def is_cellular_settings_visible(self):
105- return self._get_cellular_settings_menu_item().visible
106-
107- def open_cellular_settings(self):
108+ objectName='indicator.ethernet.settings', visible=True)
109+
110+ def is_ethernet_settings_visible(self):
111+ return self._get_ethernet_settings_menu_item().visible
112+
113+ def open_network_settings(self):
114+ if platform.get_device_name() is 'desktop':
115+ self.open_ethernet_settings()
116+ else:
117+ self.open_wifi_settings()
118+
119+ def open_ethernet_settings(self):
120 """Tap the cellular settings list item to open settings."""
121 input_manager.pointer.click_object(
122- self._get_cellular_settings_menu_item())
123+ self._get_ethernet_settings_menu_item())
124
125 def _get_wifi_settings_menu_item(self):
126 """Return the menu item which opens WiFi settings."""
127
128=== modified file 'ubuntu_system_tests/helpers/music/__init__.py'
129--- ubuntu_system_tests/helpers/music/__init__.py 2016-08-24 13:41:23 +0000
130+++ ubuntu_system_tests/helpers/music/__init__.py 2017-03-30 19:25:29 +0000
131@@ -22,16 +22,13 @@
132 APP_ID,
133 APP_WIN_ID,
134 CONFIG_FILE,
135- get_music_app_proxy,
136- is_music_app_running,
137- launch_music_app,
138+ MusicPlayer,
139 QML,
140- stop_music_app,
141 )
142 from ubuntu_system_tests.helpers.music.utils import (
143 get_current_album,
144 get_current_song,
145- set_welcome_wizard,
146+ set_welcome_wizard
147 )
148
149
150@@ -43,10 +40,7 @@
151 'CONFIG_FILE',
152 'get_current_album',
153 'get_current_song',
154- 'get_music_app_proxy',
155- 'is_music_app_running',
156- 'launch_music_app',
157 'QML',
158 'set_welcome_wizard',
159- 'stop_music_app',
160+ 'MusicPlayer'
161 ]
162
163=== modified file 'ubuntu_system_tests/helpers/music/app.py'
164--- ubuntu_system_tests/helpers/music/app.py 2016-12-01 20:46:16 +0000
165+++ ubuntu_system_tests/helpers/music/app.py 2017-03-30 19:25:29 +0000
166@@ -18,12 +18,8 @@
167
168 import os
169
170-from ubuntu_system_tests.helpers import autopilot
171 from ubuntu_system_tests.helpers import processes
172-from ubuntu_system_tests.helpers.scopes.apps import (
173- launch_application_from_apps_scope
174-)
175-from ubuntu_system_tests.helpers import wait_until
176+from ubuntu_system_tests.helpers.application import Application
177 from ubuntu_system_tests.helpers import file_system as fs
178
179 APP = 'music-app'
180@@ -35,35 +31,25 @@
181 CONFIG_FILE = os.path.join(fs.DIR_HOME_MUSIC_CONFIG, '{}.conf'.format(APP_ID))
182
183
184-def launch_music_app():
185- """
186- Launch the music app from apps scope and return proxy object.
187-
188- :return: Proxy object for music application.
189-
190- """
191- launch_application_from_apps_scope(APP_NAME)
192- wait_until(is_music_app_running, period=0.5)
193- return get_music_app_proxy()
194-
195-
196-def is_music_app_running():
197- """ Indicate if the music app is currently running """
198- return processes.is_qmlscene_running_with_qmlfile(APP)
199-
200-
201-def get_music_app_proxy():
202- """
203- Return music app proxy object from existing process.
204-
205- :return: Proxy object for music application.
206-
207- """
208- from ubuntu_system_tests.helpers.music import cpo # NOQA
209- proxy = autopilot.get_proxy_object(processes.get_qmlscene_process_id(APP))
210- return proxy.main_view
211-
212-
213-def stop_music_app():
214- """ Stop the music app qml process """
215- processes.stop_qmlscene_process(QML)
216+class MusicPlayer(Application):
217+
218+ def __init__(self):
219+ super().__init__(APP_NAME, APP_ID)
220+
221+ def is_running(self):
222+ """ Indicate if the music app is currently running """
223+ return processes.is_qmlscene_running_with_qmlfile(APP)
224+
225+ def get_main_view(self):
226+ """
227+ Return music app proxy object from existing process.
228+ :return: Proxy object for music application.
229+ """
230+ from ubuntu_system_tests.helpers.music import cpo # NOQA
231+ proxy = self.get_proxy_object()
232+ return proxy.main_view
233+
234+ @staticmethod
235+ def stop():
236+ """ Stop the music app qml process """
237+ processes.stop_qmlscene_process(QML)
238
239=== modified file 'ubuntu_system_tests/helpers/ofono/utils.py'
240--- ubuntu_system_tests/helpers/ofono/utils.py 2016-12-07 14:15:04 +0000
241+++ ubuntu_system_tests/helpers/ofono/utils.py 2017-03-30 19:25:29 +0000
242@@ -228,11 +228,14 @@
243 if no slot is specified then if a SIM is inserted in
244 any slot, otherwise False
245 """
246- bus = dbus.SystemBus()
247- for ril_modem, properties in _get_all_modems(bus):
248- if _sim_present(bus, ril_modem, properties,
249- sim_number, ignore_phonesim):
250- return True
251+ # Since phone is not really target so far, we defaul he return value to
252+ # False
253+ #
254+ # bus = dbus.SystemBus()
255+ # for ril_modem, properties in _get_all_modems(bus):
256+ # if _sim_present(bus, ril_modem, properties,
257+ # sim_number, ignore_phonesim):
258+ # return True
259 return False
260
261
262
263=== modified file 'ubuntu_system_tests/tests/base.py'
264--- ubuntu_system_tests/tests/base.py 2017-03-23 08:50:42 +0000
265+++ ubuntu_system_tests/tests/base.py 2017-03-30 19:25:29 +0000
266@@ -56,7 +56,6 @@
267 from ubuntu_system_tests.helpers.unity8.utils import (
268 disable_settings_wizard,
269 disable_edges_intro,
270- setup_unity
271 )
272
273 from ubuntu_system_tests.tests.data.definitions import DESKTOP_PLATFORM_NAME
274@@ -87,7 +86,7 @@
275 def setUp(self, custom_fixtures=[]):
276 super().setUp()
277 self.addCleanup(ensure_all_apps_closed)
278- self.addCleanup(setup_unity)
279+ # self.addCleanup(setup_unity)
280 self._reset_autopilot_registry()
281 self._init_shared_context()
282 if len(custom_fixtures) == 0:
283
284=== modified file 'ubuntu_system_tests/tests/indicators/base.py'
285--- ubuntu_system_tests/tests/indicators/base.py 2016-11-16 12:37:32 +0000
286+++ ubuntu_system_tests/tests/indicators/base.py 2017-03-30 19:25:29 +0000
287@@ -22,7 +22,6 @@
288
289
290 class IndicatorTestCaseBase(base.BaseUbuntuSystemTestCase):
291- def setUp(self, indicator):
292+ def setUp(self, name):
293 super().setUp()
294- self.indicator_page = IndicatorsFactory.get_indicators_page(indicator)
295- self.addCleanup(self.shell.close_indicator_page)
296+ self.indicator_page = IndicatorsFactory.get_indicators_page(name)
297
298=== modified file 'ubuntu_system_tests/tests/indicators/test_indicator_bluetooth.py'
299--- ubuntu_system_tests/tests/indicators/test_indicator_bluetooth.py 2016-11-16 12:34:58 +0000
300+++ ubuntu_system_tests/tests/indicators/test_indicator_bluetooth.py 2017-03-30 19:25:29 +0000
301@@ -17,9 +17,6 @@
302 # You should have received a copy of the GNU General Public License
303 # along with this program. If not, see <http://www.gnu.org/licenses/>.
304 #
305-from testtools import skipUnless
306-from ubuntu_system_tests.helpers.bluetooth import is_bluetooth_supported
307-
308 from ubuntu_system_tests.helpers import system_settings
309 from ubuntu_system_tests.helpers.indicators.bluetooth import (
310 BluetoothIndicatorPage)
311@@ -31,7 +28,6 @@
312
313 class BluetoothIndicatorTestCase(base.IndicatorTestCaseBase):
314
315- @skipUnless(is_bluetooth_supported(), 'Bluetooth support required.')
316 def setUp(self):
317 super().setUp(BluetoothIndicatorPage.name)
318
319
320=== modified file 'ubuntu_system_tests/tests/indicators/test_indicator_network.py'
321--- ubuntu_system_tests/tests/indicators/test_indicator_network.py 2016-12-02 15:06:23 +0000
322+++ ubuntu_system_tests/tests/indicators/test_indicator_network.py 2017-03-30 19:25:29 +0000
323@@ -16,166 +16,32 @@
324 #
325 # You should have received a copy of the GNU General Public License
326 # along with this program. If not, see <http://www.gnu.org/licenses/>.
327-
328-from autopilot.matchers import Eventually
329-from testtools.matchers import Equals, NotEquals
330-from testtools import skipUnless
331+from ubuntu_system_tests.helpers import platform
332 from ubuntu_system_tests.helpers.indicators.network.cpo import (
333 NetworkIndicatorPage)
334
335-from ubuntu_system_tests.helpers import (
336- radio_killswitch,
337- network,
338-)
339-from ubuntu_system_tests.helpers.ofono.fixture_setup import UnlockSims
340-from ubuntu_system_tests.helpers.ofono.utils import (
341- wait_for_all_sims_registered, is_sim_inserted, get_sim_name)
342-from ubuntu_system_tests.helpers.platform import is_wifi_supported
343-
344 from ubuntu_system_tests.helpers import system_settings
345 from ubuntu_system_tests.tests.indicators import base
346
347-
348 CELLULAR_SETTINGS_PAGE = 'cellularPage'
349 WIFI_SETTINGS_PAGE = 'wifiPage'
350
351
352-class FlightModeTestCase(base.IndicatorTestCaseBase):
353-
354- @skipUnless(is_sim_inserted() and is_wifi_supported(),
355- 'SIM and Wi-Fi support required.')
356- def setUp(self):
357- self.assertTrue(wait_for_all_sims_registered())
358- self.radio_killswitch = self.useFixture(
359- radio_killswitch.RadioKillswitch(False))
360- super().setUp(NetworkIndicatorPage.name)
361-
362- def assert_network_indicator_shows_flightmode_off(self,
363- network_indicator_page):
364- """Network indicator UI elements reflect 'off' state of flight mode."""
365- self.assertTrue(network_indicator_page.is_flight_mode_switch_visible())
366- self.assertThat(network_indicator_page.is_sim_list_offline,
367- Eventually(Equals(False)))
368- self.assertTrue(network_indicator_page.is_wifi_switch_visible())
369- self.assertThat(network_indicator_page.is_wifi_enabled,
370- Eventually(Equals(True)))
371- self.assertThat(network_indicator_page.get_list_of_wifi_access_points,
372- Eventually(NotEquals([])))
373- self.assertTrue(network_indicator_page.is_cellular_settings_visible())
374- self.assertTrue(network_indicator_page.is_wifi_settings_visible())
375-
376- def assert_network_indicator_shows_flightmode_on(self,
377- network_indicator_page):
378- """Network indicator UI elements reflect 'on' state of flight mode."""
379- self.assertThat(network_indicator_page.is_sim_list_offline,
380- Eventually(Equals(True)))
381- self.assertThat(network_indicator_page.is_wifi_enabled,
382- Eventually(Equals(False)))
383- self.assertThat(
384- network_indicator_page.get_list_of_wifi_access_points,
385- Eventually(Equals([])))
386-
387- def test_switching_on_flight_mode_must_engage_flight_mode(self):
388- """Switching on 'flight mode' in the indicator must engage flight mode.
389-
390- Note that we assume we're starting in *off* mode; also we skip
391- the test if no SIM is inserted.
392-
393- """
394- self.assertFalse(self.radio_killswitch.is_flight_mode_on(),
395- 'Test must be run with flight mode off.')
396- self.assert_network_indicator_shows_flightmode_off(
397- self.indicator_page)
398- self.indicator_page.turn_on_flight_mode()
399- self.assertThat(self.radio_killswitch.is_flight_mode_on,
400- Eventually(Equals(True)))
401- self.assert_network_indicator_shows_flightmode_on(
402- self.indicator_page)
403- self.indicator_page.turn_off_flight_mode()
404- self.assertThat(self.radio_killswitch.is_flight_mode_on,
405- Eventually(Equals(False)))
406- self.assert_network_indicator_shows_flightmode_off(
407- self.indicator_page)
408-
409- def assert_network_indicator_shows_wifi_enabled_flight_mode_on(
410- self, network_indicator_page):
411- self.assertThat(network_indicator_page.is_sim_list_offline,
412- Eventually(Equals(True)))
413- self.assertThat(network_indicator_page.is_wifi_enabled,
414- Eventually(Equals(True)))
415- self.assertThat(
416- network_indicator_page.get_list_of_wifi_access_points,
417- Eventually(NotEquals([])))
418-
419- def test_enable_wifi_in_flight_mode(self):
420- """
421- Enable flight mode and turn on wifi and check internet is working
422-
423- 1. Switch to flight mode
424- 2. Turn on Wifi
425- 3. Ensure internet is working
426- """
427- self.assertFalse(self.radio_killswitch.is_flight_mode_on(),
428- 'Test must be run with flight mode off.')
429- self.assert_network_indicator_shows_flightmode_off(
430- self.indicator_page)
431- self.indicator_page.turn_on_flight_mode()
432- self.addCleanup(self.indicator_page.turn_off_flight_mode)
433- self.assertThat(self.radio_killswitch.is_flight_mode_on,
434- Eventually(Equals(True)))
435- self.assert_network_indicator_shows_flightmode_on(
436- self.indicator_page)
437- self.indicator_page.turn_on_wifi()
438- self.assert_network_indicator_shows_wifi_enabled_flight_mode_on(
439- self.indicator_page)
440- network.ensure_internet_connectivity(timeout=15)
441-
442-
443-class CellularProvidersTestCase(base.IndicatorTestCaseBase):
444-
445- @skipUnless(is_sim_inserted(), 'At least one SIM card required')
446- def setUp(self):
447- self.assertTrue(wait_for_all_sims_registered())
448- self.useFixture(UnlockSims())
449- super().setUp(NetworkIndicatorPage.name)
450-
451- def test_cellular_providers_register(self):
452- """
453- Prerequisite: At least one SIM is inserted into the phone.
454- 1. Drag down the network indicator
455- - The network menu opens and shows the currently
456- active SIMs names.
457- """
458- sims = self.indicator_page.get_list_of_sims()
459- for index, sim in enumerate(sims):
460- self.assertEqual(sim.get_sim_name(), get_sim_name(index))
461-
462-
463 class NetworkIndicatorTestCase(base.IndicatorTestCaseBase):
464
465 def setUp(self):
466 super().setUp(NetworkIndicatorPage.name)
467
468- def test_cellular_settings_item_open_correct_page(self):
469+ def test_ethernet_settings_item_open_correct_page(self):
470 """
471 1. Drag down the network indicator
472 2. Tap 'Cellular settings...'
473 3. Ensure cellular settings open
474 """
475- self.indicator_page.open_cellular_settings()
476- settings_app = system_settings.get_system_settings_proxy()
477- system_settings.ensure_settings_page_visible(settings_app,
478- CELLULAR_SETTINGS_PAGE)
479-
480- @skipUnless(is_wifi_supported(),
481- 'Wi-Fi support required.')
482- def test_wifi_settings_item_open_correct_page(self):
483- """
484- 1. Drag down the network indicator
485- 2. Tap 'Wifi settings...'
486- 3. Ensure Wifi settings open
487- """
488- self.indicator_page.open_wifi_settings()
489- settings_app = system_settings.get_system_settings_proxy()
490- system_settings.ensure_settings_page_visible(settings_app,
491- WIFI_SETTINGS_PAGE)
492+ self.indicator_page.open_network_settings()
493+ settings_app = system_settings.get_system_settings_proxy()
494+ expected_page = WIFI_SETTINGS_PAGE if \
495+ platform.get_device_name() is not 'desktop' \
496+ else CELLULAR_SETTINGS_PAGE
497+ system_settings.ensure_settings_page_visible(settings_app,
498+ expected_page)
499
500=== modified file 'ubuntu_system_tests/tests/indicators/test_indicator_sound.py'
501--- ubuntu_system_tests/tests/indicators/test_indicator_sound.py 2016-12-02 18:49:50 +0000
502+++ ubuntu_system_tests/tests/indicators/test_indicator_sound.py 2017-03-30 19:25:29 +0000
503@@ -17,16 +17,16 @@
504 # You should have received a copy of the GNU General Public License
505 # along with this program. If not, see <http://www.gnu.org/licenses/>.
506 #
507-
508+import os
509 import shutil
510
511 from autopilot.matchers import Eventually
512 from testtools.matchers import Equals, NotEquals
513
514+from ubuntu_system_tests.helpers.music.app import MusicPlayer
515 from ubuntu_system_tests.helpers.unity8.utils import close_all_apps
516 from ubuntu_system_tests.helpers.indicators.sound import SoundIndicatorPage
517 from ubuntu_system_tests.helpers import media
518-from ubuntu_system_tests.helpers import music
519 from ubuntu_system_tests.helpers import system_settings
520 from ubuntu_system_tests.helpers.indicators.indicators import IndicatorsFactory
521 from ubuntu_system_tests.helpers.music import fixture_setup as music_fixture
522@@ -34,6 +34,7 @@
523 from ubuntu_system_tests.tests.indicators import base
524 from ubuntu_system_tests.tests import data as test_data
525
526+from ubuntu_system_tests.helpers import file_system as fs
527
528 SOUND_SETTINGS_PAGE = 'soundPage'
529
530@@ -61,9 +62,16 @@
531 super().setUp()
532 self.useFixture(media.BackupRestoreLocalMediaFixture())
533 self.useFixture(music_fixture.MusicAppWelcomeWizard(show_wizard=True))
534+
535+ if not os.path.exists(fs.DIR_HOME_MUSIC):
536+ os.makedirs(fs.DIR_HOME_MUSIC)
537 shutil.copy2(test_data.SRC_AUDIO_FILE_2, test_data.LOCAL_AUDIO_FILE_2)
538 shutil.copy2(test_data.SRC_AUDIO_FILE_4, test_data.LOCAL_AUDIO_FILE_4)
539- self.music_app = music.launch_music_app()
540+
541+ music_player = MusicPlayer()
542+ music_player.launch_from_app_drawer()
543+
544+ self.music_app = music_player.get_main_view()
545 self.music_app.ensure_walkthrough_page_not_visible()
546
547 def test_play_pause_track_from_indicator(self):

Subscribers

People subscribed via source and target branches