@@ -1,47 +1,22 @@
4from unity8.settings_wizard import fixture_setup
1from unity8.settings_wizard import fixture_setup
5from unity8.settings_wizard.emulators.settings_wizard import Wizard
2from unity8.settings_wizard.emulators.settings_wizard import Wizard
6−from unity8.settings_wizard.phonesim_manager import PhonesimManager
7from unity8.shell import tests
3from unity8.shell import tests
9DEFAULT_LANGUAGE = 'English (United States)'
5DEFAULT_LANGUAGE = 'English (United States)'
10DEFAULT_PHONESIM_CONFIG_FILE = '/usr/share/phonesim/default.xml'
6DEFAULT_PHONESIM_CONFIG_FILE = '/usr/share/phonesim/default.xml'
11DEFAULT_SECURITY_METHOD = 'Passcode'
7DEFAULT_SECURITY_METHOD = 'Passcode'
16class SkipThroughSettingsWizardTestCase(tests.UnityTestCase):
10class SkipThroughSettingsWizardTestCase(tests.UnityTestCase):
17 """ Autopilot test for completing settings wizard """
11 """ Autopilot test for completing settings wizard """
19 def setUp(self):
13 def setUp(self):
20 super().setUp()
14 super().setUp()
21− phonesim_datadir = os.getenv('INDICATOR_NETWORK_PHONESIM_DATA')
22− if phonesim_datadir is None:
23− phonesim_datadir = sysconfig.get_config_var('datarootdir') + \
24− '/indicator-network/phonesim'
28− phonesim_datadir + '/pin-unlock.xml')]
29− self.phonesim_manager = PhonesimManager(sims)
30 self.wizard_helper = self.useFixture(
15 self.wizard_helper = self.useFixture(
31 fixture_setup.SettingsWizard(True))
16 fixture_setup.SettingsWizard(True))
33− self.phonesim_manager.start_phonesim_processes()
34− self.phonesim_manager.remove_all_ofono()
35− self.phonesim_manager.add_ofono('sim1')
36− self.phonesim_manager.power_on('sim1')
37− self.phonesim_manager.power_off('sim1')
39 self.unity = self.launch_unity()
17 self.unity = self.launch_unity()
40 self.wizard = self._get_settings_wizard()
18 self.wizard = self._get_settings_wizard()
43− self.phonesim_manager.shutdown()
45 def _get_settings_wizard(self):
20 def _get_settings_wizard(self):
46 return self.unity.wait_select_single(Wizard)
21 return self.unity.wait_select_single(Wizard)
@@ -61,15 +36,19 @@ class SkipThroughSettingsWizardTestCase(tests.UnityTestCase):
61 password_page.select_security_option('Swipe')
36 password_page.select_security_option('Swipe')
62 return password_page.continue_()
37 return password_page.continue_()
39+ def _test_wifi_connect_page(self, wifi_connect_page):
40+ return wifi_connect_page.advance_page()
64 def test_skipping_through_wizard(self):
42 def test_skipping_through_wizard(self):
65 """ Most basic test of the settings wizard. Skip all skipable pages """
43 """ Most basic test of the settings wizard. Skip all skipable pages """
66− # FIXME for now, assume there is no SIM card in the phone
67− # A mock should allow testing both situations later
68 sim_inserted, next_page = self._test_language_page()
44 sim_inserted, next_page = self._test_language_page()
46+ password_page = next_page
69− password_page = next_page.skip()
48+ password_page = next_page.skip()
70 wifi_connect_page = self._test_password_page(password_page)
49 wifi_connect_page = self._test_password_page(password_page)
71 # FIXME This _will_ not work without a mock as the behavior is
50 # FIXME This _will_ not work without a mock as the behavior is
72 # dependent on weather or not there is a connection to a wifi network
51 # dependent on weather or not there is a connection to a wifi network
73− reporting_page = wifi_connect_page.skip()
52+ reporting_page = self._test_wifi_connect_page(wifi_connect_page)
74 finish_page = reporting_page.continue_()
53 finish_page = reporting_page.continue_()
75 finish_page.finish()
54 finish_page.finish()