def test_sim_pin_lock_control_unlock(self): sim_pin_page = self.security_page.go_to_sim_lock() switch = sim_pin_page.get_sim_pin_switch(0) self.assertTrue(switch.checked) sim_pin_page.click_sim_pin_switch(0) lock_dialog = self.main_view.select_single( objectName='lockDialogComponent') self.assertEqual(lock_dialog.title, _("Enter SIM PIN")) prev_input = self.main_view.select_single(objectName='prevInput') submit_button = self.main_view.select_single(objectName='lockButton') self.assertEqual(submit_button.text, _("Unlock")) self.assertFalse(submit_button.enabled) self.main_view.scroll_to_and_click(prev_input) prev_input.write("246") self.assertFalse(submit_button.enabled) prev_input.write("2468") self.assertTrue(submit_button.enabled) self.main_view.scroll_to_and_click(submit_button) self.assertFalse(switch.checked) locked = len(self.modem_0.Get(SIM_IFACE, 'LockedPins')) > 0 self.assertEquals(locked, switch.checked)
def test_sim_pin_lock_control_lock_fail(self): sim_pin_page = self.security_page.go_to_sim_lock() self.assertFalse(len(self.modem_0.Get(SIM_IFACE, 'LockedPins')) > 0) sim_pin_page.click_sim_pin_switch(0) lock_dialog = self.main_view.select_single( objectName='lockDialogComponent') self.assertEqual(lock_dialog.title, _("Enter Previous SIM PIN")) prev_input = self.main_view.select_single(objectName='prevInput') submit_button = self.main_view.select_single(objectName='lockButton') self.assertThat(submit_button.text, Eventually(Equals(_("Lock")))) self.assertFalse(submit_button.enabled) self.main_view.scroll_to_and_click(prev_input) prev_input.write("1234") self.assertTrue(submit_button.enabled) self.main_view.scroll_to_and_click(submit_button) self.assertFalse(len(self.modem_0.Get(SIM_IFACE, 'LockedPins')) > 0)
def _get_last_updated_date(self): info = self._get_system_image_iface()[3] if info == 'Unknown': return _('Never') else: return dateutil.parser.parse(info.split()[0]).date()
def test_title(self): """ Checks whether the app title is correct """ header = self.main_view.select_single( objectName='systemSettingsPage' ) self.assertThat(header, NotEquals(None)) self.assertThat(header.title, Eventually(Equals(_('System Settings'))))
def test_network_category(self): """ Checks whether the Network category is available """ category = self.main_view.select_single( objectName='categoryGrid-network') self.assertThat(category, NotEquals(None)) self.assertThat(category.categoryName, Eventually(Equals(_('Network'))))
def test_personal_category(self): """ Checks whether the Personal category is available """ category = self.main_view.select_single( objectName='categoryGrid-personal') self.assertThat(category, NotEquals(None)) self.assertThat(category.categoryName, Eventually(Equals(_('Personal'))))
def test_phone_lock_page(self): self._go_to_phone_lock() phone_lock_page = self.main_view.select_single( objectName='phoneLockingPage') self.assertThat(phone_lock_page, NotEquals(None)) self.assertThat(phone_lock_page.title, Equals(_('Locking and unlocking')))
def _type_into_search_box(self, text): self.main_view.click_header_action('searchAction') search_box = self.main_view.select_single( objectName='searchTextField' ) self.main_view.scroll_to_and_click(search_box) search_box.write(_(text)) self.assertThat(search_box.text, Eventually(Equals(text)))
def test_sim_pin_control_value(self): self.assertEqual('none', self.modem_0.Get(SIM_IFACE, 'PinRequired')) self.assertEqual(['pin'], self.modem_0.Get(SIM_IFACE, 'LockedPins')) sim_pin_value = self.security_page.select_single( objectName='simControl').value self.assertThat(sim_pin_value, Equals(_('On')))
def test_sound_page(self): """ Checks whether Sound page is available """ self.assertThat( self.sound_page, NotEquals(None) ) self.assertThat( self.sound_page.title, Equals(_('Sound')) )
def test_same_tz_selection(self): """Check that manually setting a timezone then setting the same one doesn't take you back to the index. """ # Set tz to London listview = self.search_kb_type('London, United Kingdom') london = TimeDateTestCase.wait_select_listview_first(listview) self.main_view.pointing_device.click_object(london) sleep(2) # This is also in Europe/London listview = self.search_kb_type('Preston, United Kingdom') preston = TimeDateTestCase.wait_select_listview_first(listview) self.main_view.pointing_device.click_object(preston) # The timer is 1 second, wait and see that we haven't moved pages sleep(2) header = self.main_view.wait_select_single( objectName='MainView_Header' ) self.assertThat(header.title, Eventually(Equals(_('Time zone'))))
def test_time_date_page(self): """ Checks whether Time & Date page is available """ self.assertEqual(self.page.title, _('Time & Date'))
def test_space_used_by_apps(self): """ Checks whether space item is available """ self.assert_space_item('usedByAppsItem', _('Used by apps'))
def test_space_other_files(self): """ Checks whether space item is available """ self.assert_space_item('otherFilesItem', _('Other files'))
def test_space(self): """ Checks whether storage item is available """ self.assert_space_item('storageItem', _('Free space'))
def test_security_page(self): """ Checks whether Security page is available """ self.assertThat(self.security_page, NotEquals(None)) self.assertThat(self.security_page.title, Equals(_('Security & Privacy')))
def test_reset_page_title_is_correct(self): """Checks whether Reset page is available""" self.assertThat( self.reset_page.title, Equals(_('Reset device')))
def test_language_page_title_is_correct(self): """Checks whether Language page is available""" self.assertThat( self.language_page.title, Equals(_('Language & Text')))
def test_space_ubuntu(self): """ Checks storage item """ self.assert_space_item('usedByUbuntuItem', _('Used by Ubuntu'))
def test_wifi_page_title_is_correct(self): """Checks whether Wifi page is available""" self.assertThat( self.wifi_page.title, Equals(_('Wi-Fi')))
def test_background_page_title_is_correct(self): """ Checks whether Background page is available """ self.assertThat(self.background_page.title, Equals(_('Background')))