class TestUtilityTrayVisibilityAccessibility(GaiaTestCase): def setUp(self): GaiaTestCase.setUp(self) self.system = System(self.marionette) self.status_bar = self.system.status_bar self.utility_tray = UtilityTray(self.marionette) def test_a11y_utility_tray_visibility(self): self.system.wait_for_status_bar_displayed() utility_tray_container = self.marionette.find_element(*self.system._utility_tray_locator) # Utility tray is hidden by default. self.assertTrue(self.accessibility.is_hidden(utility_tray_container)) self.status_bar.a11y_wheel_status_bar_time() self.utility_tray.wait_for_dropped_down() # Utility tray should now be visible. self.assertTrue(self.accessibility.is_visible(utility_tray_container)) self.utility_tray.a11y_wheel_utility_tray_grippy() # Utility tray should now be hidden. self.assertTrue(self.accessibility.is_hidden(utility_tray_container))
def test_IMAP_email_notification(self): """ https://moztrap.mozilla.org/manage/case/10744/""" # setup email account self.email.setup_IMAP_email(self.environment.email['imap'], self.environment.email['smtp']) # check account has emails self.email.wait_for_emails_to_sync() self.assertGreater(len(self.email.mails), 0) # Touch home button to exit email app self.device.touch_home_button() # send email to IMAP account mock_email = MockEmail(self.environment.host['smtp']['email'], self.environment.email['imap']['email']) EmailUtil().send(self.environment.host['smtp'], mock_email) self.marionette.switch_to_frame() system = System(self.marionette) # Wait for email notification system.wait_for_notification_toaster_displayed(timeout=60, for_app='email') system.wait_for_notification_toaster_not_displayed() system.wait_for_status_bar_displayed() utility_tray = system.open_utility_tray() notifications = utility_tray.get_notifications(for_app='email') self.assertEqual(1, len(notifications), 'Expected one email notification.') email = notifications[0].tap_notification() email.wait_to_be_displayed() self.apps.switch_to_displayed_app() # Wait for senders email to be shown email.wait_for_senders_email_displayed() # check if the sender's email address is fine self.assertEqual( email.senders_email, mock_email['from'], 'Senders\'s email on the inbox screen is incorrect. ' 'Expected email is %s. Actual email is %s.' % (mock_email['from'], email.senders_email)) # check if the subject is fine self.assertEqual( email.subject, mock_email['subject'], 'Senders\'s email on the inbox screen is incorrect. ' 'Expected subject is %s. Actual subject is %s.' % (mock_email['subject'], email.subject)) # check if the email message is fine self.assertEqual( email.body, mock_email['message'], 'Email message on read email screen is incorrect. ' 'Expected message is "%s". Actual message is ' '"%s".' % (mock_email['message'], email.body))
class TestUtilityTrayVisibilityAccessibility(GaiaTestCase): def setUp(self): GaiaTestCase.setUp(self) self.system = System(self.marionette) self.status_bar = StatusBar(self.marionette) self.utility_tray = UtilityTray(self.marionette) def test_a11y_utility_tray_visibility(self): self.system.wait_for_status_bar_displayed() utility_tray_container = self.marionette.find_element( *self.system._utility_tray_locator) # Utility tray is hidden by default. self.assertTrue(self.accessibility.is_hidden(utility_tray_container)) self.status_bar.a11y_wheel_status_bar_time() self.utility_tray.wait_for_notification_container_displayed() # Utility tray should now be visible. self.assertTrue(self.accessibility.is_visible(utility_tray_container)) self.utility_tray.a11y_wheel_utility_tray_grippy() # Utility tray should now be hidden. self.assertTrue(self.accessibility.is_hidden(utility_tray_container))
def test_notification_bar(self): system = System(self.marionette) # Push a notification self.marionette.execute_script( 'navigator.mozNotification.createNotification("%s", "%s").show();' % (self._notification_title, self._notification_body)) system.wait_for_notification_toaster_displayed() system.wait_for_notification_toaster_not_displayed() # Expand the notification bar system.wait_for_status_bar_displayed() utility_tray = system.open_utility_tray() utility_tray.wait_for_notification_container_displayed() # Assert there is one notification is listed in notifications-container notifications = utility_tray.notifications self.assertEqual(1, len(notifications), 'Expected one notification.') # Assert notification is listed in notifications-container self.assertEqual(self._notification_body, notifications[0].content) # Clear the notification by "Clear all" utility_tray.clear_all_notifications() # wait for the notifications to be cleared self.wait_for_condition(lambda m: len(utility_tray.notifications) == 0) # Assert there is no notification is listed in notifications-container self.assertEqual(0, len(utility_tray.notifications))
def test_notification_bar(self): system = System(self.marionette) # Push a notification self.marionette.execute_script('navigator.mozNotification.createNotification("%s", "%s").show();' % (self._notification_title, self._notification_body)) system.wait_for_notification_toaster_displayed() system.wait_for_notification_toaster_not_displayed() # Expand the notification bar system.wait_for_status_bar_displayed() utility_tray = system.open_utility_tray() utility_tray.wait_for_notification_container_displayed() # Assert there is one notification is listed in notifications-container notifications = utility_tray.notifications self.assertEqual(1, len(notifications), 'Expected one notification.') # Assert notification is listed in notifications-container self.assertEqual(self._notification_body, notifications[0].content) # Clear the notification by "Clear all" utility_tray.clear_all_notifications() # wait for the notifications to be cleared self.wait_for_condition(lambda m: len(utility_tray.notifications) == 0) # Assert there is no notification is listed in notifications-container self.assertEqual(0, len(utility_tray.notifications))
def test_notification_bar(self): system = System(self.marionette) # Push a notification self.marionette.execute_script( 'new Notification("%s", {body: "%s"});' % (self._notification_title, self._notification_body)) system.wait_for_notification_toaster_displayed(for_app='system') system.wait_for_notification_toaster_not_displayed() system.wait_for_status_bar_displayed() utility_tray = system.open_utility_tray() notifications = utility_tray.get_notifications(for_app='system') self.assertEqual(1, len(notifications), 'Expected one system notification.') self.assertEqual(self._notification_body, notifications[0].content) # We cannot disable app update yet so let's wait for it to pass if system.is_app_update_notification_displayed: system.wait_for_app_update_to_clear() utility_tray.clear_all_notifications() self.assertEqual(0, len(utility_tray.notifications))
def test_receive_active_sync_email(self): # setup ActiveSync account email = Email(self.marionette) email.launch() email.setup_active_sync_email(self.testvars['email']['ActiveSync']) # wait for sync to complete email.wait_for_emails_to_sync() # Touch home button to exit email app self.device.touch_home_button() # send email to active sync account mock_email = MockEmail( senders_email=self.testvars['email']['IMAP']['email'], recipients_email=self.testvars['email']['ActiveSync']['email']) EmailUtil().send(self.testvars['email']['IMAP'], mock_email) self.marionette.switch_to_frame() system = System(self.marionette) # Wait for email notification system.wait_for_notification_toaster_displayed(timeout=60) system.wait_for_notification_toaster_not_displayed() # Expand the notification bar system.wait_for_status_bar_displayed() utility_tray = system.open_utility_tray() utility_tray.wait_for_notification_container_displayed() # Assert there is one notification is listed in notifications-container notifications = utility_tray.notifications self.assertEqual(1, len(notifications), 'Expected one notification.') email = notifications[0].tap_notification() self.wait_for_condition( lambda m: self.apps.displayed_app.name == "E-Mail") self.apps.switch_to_displayed_app() # check if the sender's email address is fine self.assertEqual( email.senders_email, mock_email.senders_email, 'Senders\'s email on the inbox screen is incorrect. ' 'Expected email is %s. Actual email is %s.' % (mock_email.senders_email, email.senders_email)) # check if the subject is fine self.assertEqual( email.subject, mock_email.subject, 'Senders\'s email on the inbox scrseen is incorrect. ' 'Expected subject is %s. Actual subject is %s.' % (mock_email.subject, email.subject)) # check if the email message is fine self.assertEqual( email.body, mock_email.message, 'Email message on read email screen is incorrect. ' 'Expected message is "%s". Actual message is ' '"%s".' % (mock_email.message, email.body))
def test_IMAP_email_notification(self): """ https://moztrap.mozilla.org/manage/case/10744/""" # setup email account self.email.setup_IMAP_email(self.testvars['email']['IMAP']) # check account has emails self.email.wait_for_emails_to_sync() self.assertGreater(len(self.email.mails), 0) # Touch home button to exit email app self.device.touch_home_button() # send email to IMAP account mock_email = MockEmail(senders_email=self.testvars['email']['IMAP']['email'], recipients_email=self.testvars['email']['IMAP']['email']) EmailUtil().send(self.testvars['email']['IMAP'], mock_email) self.marionette.switch_to_frame() system = System(self.marionette) # Wait for email notification system.wait_for_notification_toaster_displayed(timeout=60) system.wait_for_notification_toaster_not_displayed() # Expand the notification bar system.wait_for_status_bar_displayed() utility_tray = system.open_utility_tray() utility_tray.wait_for_notification_container_displayed() # Assert there is one notification and is listed in notifications-container notifications = utility_tray.notifications self.assertEqual(1, len(notifications), 'Expected one notification.') email = notifications[0].tap_notification() self.wait_for_condition(lambda m: self.apps.displayed_app.name == self.email.name) self.apps.switch_to_displayed_app() # Wait for senders email to be shown email.wait_for_senders_email_displayed() # check if the sender's email address is fine self.assertEqual(email.senders_email, mock_email.senders_email, 'Senders\'s email on the inbox screen is incorrect. ' 'Expected email is %s. Actual email is %s.' % ( mock_email.senders_email, email.senders_email)) # check if the subject is fine self.assertEqual(email.subject, mock_email.subject, 'Senders\'s email on the inbox screen is incorrect. ' 'Expected subject is %s. Actual subject is %s.' % ( mock_email.subject, email.subject)) # check if the email message is fine self.assertEqual(email.body, mock_email.message, 'Email message on read email screen is incorrect. ' 'Expected message is "%s". Actual message is ' '"%s".' % (mock_email.message, email.body))
def test_notification_bar(self): system = System(self.marionette) # Push a notification self.marionette.execute_script( 'new Notification("%s", {body: "%s"});' % (self._notification_title, self._notification_body)) system.wait_for_notification_toaster_displayed(for_app='system') system.wait_for_notification_toaster_not_displayed() # Expand the notification bar system.wait_for_status_bar_displayed() utility_tray = system.open_utility_tray() utility_tray.wait_for_notification_container_displayed() notifications = utility_tray.get_notifications(for_app='system') self.assertEqual(1, len(notifications), 'Expected one system notification.') email = notifications[0].tap_notification() # We cannot disable app update yet so let's wait for it to pass if system.is_app_update_notification_displayed: system.wait_for_app_update_to_clear() # Clear the notification by "Clear all" utility_tray.clear_all_notifications() # wait for the notifications to be cleared self.wait_for_condition(lambda m: len(utility_tray.notifications) == 0) # Assert there is no notification is listed in notifications-container self.assertEqual(0, len(utility_tray.notifications))
def test_receive_active_sync_email(self): # setup ActiveSync account email = Email(self.marionette) email.launch() email.setup_active_sync_email( self.testvars['email']['ActiveSync']) # wait for sync to complete email.wait_for_emails_to_sync() # Touch home button to exit email app self.device.touch_home_button() # send email to active sync account mock_email = MockEmail(senders_email=self.testvars['email']['IMAP']['email'], recipients_email=self.testvars['email']['ActiveSync']['email']) EmailUtil().send(self.testvars['email']['IMAP'], mock_email) self.marionette.switch_to_frame() system = System(self.marionette) # Wait for email notification system.wait_for_notification_toaster_displayed(timeout=30) system.wait_for_notification_toaster_not_displayed() # Expand the notification bar system.wait_for_status_bar_displayed() utility_tray = system.open_utility_tray() utility_tray.wait_for_notification_container_displayed() # Assert there is one notification is listed in notifications-container notifications = utility_tray.notifications self.assertEqual(1, len(notifications), 'Expected one notification.') email = notifications[0].tap_notification() self.apps.switch_to_displayed_app() # check if the sender's email address is fine self.assertEqual(email.senders_email, mock_email.senders_email, 'Senders\'s email on the inbox screen is incorrect. ' 'Expected email is %s. Actual email is %s.' % ( mock_email.senders_email, email.senders_email)) # check if the subject is fine self.assertEqual(email.subject, mock_email.subject, 'Senders\'s email on the inbox scrseen is incorrect. ' 'Expected subject is %s. Actual subject is %s.' % ( mock_email.subject, email.subject)) # check if the email message is fine self.assertEqual(email.body, mock_email.message, 'Email message on read email screen is incorrect. ' 'Expected message is "%s". Actual message is ' '"%s".' % (mock_email.message, email.body))
def test_notification_bar(self): system = System(self.marionette) # Push a notification self.marionette.execute_script('new Notification("%s", {body: "%s"});' % (self._notification_title, self._notification_body)) system.wait_for_notification_toaster_displayed(for_app='system') system.wait_for_notification_toaster_not_displayed() # Expand the notification bar system.wait_for_status_bar_displayed() utility_tray = system.open_utility_tray() utility_tray.wait_for_notification_container_displayed() notifications = utility_tray.get_notifications(for_app='system') self.assertEqual(1, len(notifications), 'Expected one system notification.') self.assertEqual(self._notification_body, notifications[0].content) # We cannot disable app update yet so let's wait for it to pass if system.is_app_update_notification_displayed: system.wait_for_app_update_to_clear() # Clear the notification by "Clear all" utility_tray.clear_all_notifications() # wait for the notifications to be cleared self.wait_for_condition(lambda m: len(utility_tray.notifications) == 0) # Assert there is no notification is listed in notifications-container self.assertEqual(0, len(utility_tray.notifications))
def test_IMAP_email_notification(self): """ https://moztrap.mozilla.org/manage/case/10744/""" # setup email account self.email.setup_IMAP_email(self.testvars['email']['IMAP']) # check account has emails self.email.wait_for_emails_to_sync() self.assertGreater(len(self.email.mails), 0) # Touch home button to exit email app self.device.touch_home_button() # send email to IMAP account mock_email = MockEmail( senders_email=self.testvars['email']['IMAP']['email'], recipients_email=self.testvars['email']['IMAP']['email']) EmailUtil().send(self.testvars['email']['IMAP'], mock_email) self.marionette.switch_to_frame() system = System(self.marionette) # Wait for email notification system.wait_for_notification_toaster_displayed(timeout=60) system.wait_for_notification_toaster_not_displayed() # Expand the notification bar system.wait_for_status_bar_displayed() utility_tray = system.open_utility_tray() utility_tray.wait_for_notification_container_displayed() # Assert there is one notification and is listed in notifications-container notifications = utility_tray.notifications self.assertEqual(1, len(notifications), 'Expected one notification.') email = notifications[0].tap_notification() self.wait_for_condition( lambda m: self.apps.displayed_app.name == self.email.name) self.apps.switch_to_displayed_app() # check if the sender's email address is fine self.assertEqual( email.senders_email, mock_email.senders_email, 'Senders\'s email on the inbox screen is incorrect. ' 'Expected email is %s. Actual email is %s.' % (mock_email.senders_email, email.senders_email)) # check if the subject is fine self.assertEqual( email.subject, mock_email.subject, 'Senders\'s email on the inbox screen is incorrect. ' 'Expected subject is %s. Actual subject is %s.' % (mock_email.subject, email.subject)) # check if the email message is fine self.assertEqual( email.body, mock_email.message, 'Email message on read email screen is incorrect. ' 'Expected message is "%s". Actual message is ' '"%s".' % (mock_email.message, email.body))
def test_dialer_clear_miss_call_notification(self): """ Pre-requisites: Have a voicemail in the notification bar and a missed call notification Repro Steps: 1) Open the notification panel and tap the missed call notification. 2) After the call log appears, drop down the notification panel again. 3) The notification for the call that was just tapped is no longer present. """ PLIVO_TIMEOUT = 30 plivo_phone_number = self.testvars["plivo"]["phone_number"] # Create a missed call notification from gaiatest.utils.plivo.plivo_util import PlivoUtil self.plivo = PlivoUtil( self.testvars["plivo"]["auth_id"], self.testvars["plivo"]["auth_token"], plivo_phone_number ) self.call_uuid = self.plivo.make_call( to_number=self.testvars["local_phone_numbers"][0].replace("+", ""), timeout=PLIVO_TIMEOUT ) call_screen = CallScreen(self.marionette) call_screen.wait_for_incoming_call() self.plivo.hangup_call(self.call_uuid) Wait(self.plivo, timeout=PLIVO_TIMEOUT).until( lambda p: p.is_call_completed(self.call_uuid), message="Plivo didn't report the call as completed" ) self.call_uuid = None system = System(self.marionette) self.marionette.switch_to_frame() system.wait_for_notification_toaster_displayed() system.wait_for_notification_toaster_not_displayed() # Open the notification panel system.wait_for_status_bar_displayed() utility_tray = system.open_utility_tray() utility_tray.wait_for_notification_container_displayed() # Verify the user sees the missed call event in the notification center notifications = utility_tray.notifications self.assertEqual(len(notifications), 2) self.assertEqual(notifications[0].title, "Missed call") # Remove the first digit (country code) which is not displayed for AT&T/USA - Bug 1088756 self.assertTrue(plivo_phone_number[1:] in notifications[0].content) self.assertEqual(notifications[1].title, "Voicemail") notifications[0].tap_notification() self.marionette.switch_to_frame() system.open_utility_tray() notifications = utility_tray.notifications self.assertEqual(len(notifications), 1) self.assertEqual(notifications[0].title, "Voicemail")
def test_dialer_miss_call_from_known_contact_notification(self): """ https://moztrap.mozilla.org/manage/case/9294/ """ PLIVO_TIMEOUT = 30 self.device.lock() from gaiatest.utils.plivo.plivo_util import PlivoUtil self.plivo = PlivoUtil( self.testvars['plivo']['auth_id'], self.testvars['plivo']['auth_token'], self.testvars['plivo']['phone_number'] ) self.call_uuid = self.plivo.make_call( to_number=self.testvars['local_phone_numbers'][0].replace('+', ''), timeout=PLIVO_TIMEOUT) call_screen = CallScreen(self.marionette) call_screen.wait_for_incoming_call_with_locked_screen() self.plivo.hangup_call(self.call_uuid) Wait(self.plivo, timeout=PLIVO_TIMEOUT).until( lambda p: p.is_call_completed(self.call_uuid), message="Plivo didn't report the call as completed") self.call_uuid = None lock_screen = LockScreen(self.marionette) lock_screen.switch_to_frame() lock_screen.wait_for_notification() # Check if the screen is turned on self.assertTrue(self.device.is_screen_enabled) # Verify the user sees a missed call notification message # and the known contacts info is shown. self.assertTrue(lock_screen.notifications[0].is_visible) self.assertEqual(lock_screen.notifications[0].title, 'Missed call') self.assertTrue(self.contact.givenName in lock_screen.notifications[0].content) self.device.unlock() system = System(self.marionette) system.wait_for_notification_toaster_not_displayed() # Expand the notification bar system.wait_for_status_bar_displayed() utility_tray = system.open_utility_tray() utility_tray.wait_for_notification_container_displayed() # Verify the user sees the missed call event in the notification center # and the known contacts info is shown. notifications = utility_tray.notifications self.assertEqual(notifications[0].title, 'Missed call') self.assertTrue(self.contact.givenName in notifications[0].content)
def test_IMAP_email_notification(self): """ https://moztrap.mozilla.org/manage/case/10744/""" # setup email account self.email.setup_IMAP_email(self.environment.email['imap'], self.environment.email['smtp']) # check account has emails self.email.wait_for_emails_to_sync() self.assertGreater(len(self.email.mails), 0) # Touch home button to exit email app self.device.touch_home_button() # send email to IMAP account mock_email = MockEmail(self.environment.host['smtp']['email'], self.environment.email['imap']['email']) EmailUtil().send(self.environment.host['smtp'], mock_email) self.marionette.switch_to_frame() system = System(self.marionette) # Wait for email notification system.wait_for_notification_toaster_displayed(timeout=60, for_app='email') system.wait_for_notification_toaster_not_displayed() system.wait_for_status_bar_displayed() utility_tray = system.open_utility_tray() notifications = utility_tray.get_notifications(for_app='email') self.assertEqual(1, len(notifications), 'Expected one email notification.') email = notifications[0].tap_notification() email.wait_to_be_displayed() self.apps.switch_to_displayed_app() # Wait for senders email to be shown email.wait_for_senders_email_displayed() # check if the sender's email address is fine self.assertEqual(email.senders_email, mock_email['from'], 'Senders\'s email on the inbox screen is incorrect. ' 'Expected email is %s. Actual email is %s.' % ( mock_email['from'], email.senders_email)) # check if the subject is fine self.assertEqual(email.subject, mock_email['subject'], 'Senders\'s email on the inbox screen is incorrect. ' 'Expected subject is %s. Actual subject is %s.' % ( mock_email['subject'], email.subject)) # check if the email message is fine self.assertEqual(email.body, mock_email['message'], 'Email message on read email screen is incorrect. ' 'Expected message is "%s". Actual message is ' '"%s".' % (mock_email['message'], email.body))
def test_dialer_miss_call_from_known_contact_notification(self): """ https://moztrap.mozilla.org/manage/case/9294/ """ PLIVO_TIMEOUT = 30 self.device.lock() from gaiatest.utils.plivo.plivo_util import PlivoUtil self.plivo = PlivoUtil(self.testvars['plivo']['auth_id'], self.testvars['plivo']['auth_token'], self.testvars['plivo']['phone_number']) self.call_uuid = self.plivo.make_call( to_number=self.testvars['local_phone_numbers'][0].replace('+', ''), timeout=PLIVO_TIMEOUT) call_screen = CallScreen(self.marionette) call_screen.wait_for_incoming_call_with_locked_screen() self.plivo.hangup_call(self.call_uuid) Wait(self.plivo, timeout=PLIVO_TIMEOUT).until( lambda p: p.is_call_completed(self.call_uuid), message="Plivo didn't report the call as completed") self.call_uuid = None lock_screen = LockScreen(self.marionette) lock_screen.switch_to_frame() lock_screen.wait_for_notification() # Check if the screen is turned on self.assertTrue(self.device.is_screen_enabled) # Verify the user sees a missed call notification message # and the known contacts info is shown. self.assertTrue(lock_screen.notifications[0].is_visible) self.assertEqual(lock_screen.notifications[0].title, 'Missed call') self.assertTrue( self.contact.givenName in lock_screen.notifications[0].content) self.device.unlock() system = System(self.marionette) system.wait_for_notification_toaster_not_displayed() # Expand the notification bar system.wait_for_status_bar_displayed() utility_tray = system.open_utility_tray() utility_tray.wait_for_notification_container_displayed() # Verify the user sees the missed call event in the notification center # and the known contacts info is shown. notifications = utility_tray.notifications self.assertEqual(notifications[0].title, 'Missed call') self.assertTrue(self.contact.givenName in notifications[0].content)
def test_dialer_clear_miss_call_notification(self): """ Pre-requisites: Have a voicemail in the notification bar and a missed call notification Repro Steps: 1) Open the notification panel and tap the missed call notification. 2) After the call log appears, drop down the notification panel again. 3) The notification for the call that was just tapped is no longer present. """ plivo_phone_number = self.testvars['plivo']['phone_number'] # Create a missed call notification from gaiatest.utils.plivo.plivo_util import PlivoUtil self.plivo = PlivoUtil( self.testvars['plivo']['auth_id'], self.testvars['plivo']['auth_token'], plivo_phone_number, ) self.call_uuid = self.plivo.make_call( to_number=self.testvars['local_phone_numbers'][0].replace('+', '')) call_screen = CallScreen(self.marionette) call_screen.wait_for_incoming_call() self.plivo.hangup_call(self.call_uuid) self.plivo.wait_for_call_completed(self.call_uuid) self.call_uuid = None system = System(self.marionette) self.marionette.switch_to_frame() system.wait_for_notification_toaster_displayed() system.wait_for_notification_toaster_not_displayed() # Open the notification panel system.wait_for_status_bar_displayed() utility_tray = system.open_utility_tray() utility_tray.wait_for_notification_container_displayed() # Verify the user sees the missed call event in the notification center notifications = utility_tray.notifications self.assertEqual(len(notifications), 2) self.assertEqual(notifications[0].title, 'Missed call') # Remove the first digit (country code) which is not displayed for AT&T/USA - Bug 1088756 self.assertTrue(plivo_phone_number[1:] in notifications[0].content) self.assertEqual(notifications[1].title, 'Voicemail') notifications[0].tap_notification() self.marionette.switch_to_frame() system.open_utility_tray() notifications = utility_tray.notifications self.assertEqual(len(notifications), 1) self.assertEqual(notifications[0].title, 'Voicemail')
def test_dialer_clear_miss_call_notification(self): """ Pre-requisites: Have a voicemail in the notification bar and a missed call notification Repro Steps: 1) Open the notification panel and tap the missed call notification. 2) After the call log appears, drop down the notification panel again. 3) The notification for the call that was just tapped is no longer present. """ plivo_phone_number = self.testvars['plivo']['phone_number'] # Create a missed call notification from gaiatest.utils.plivo.plivo_util import PlivoUtil self.plivo = PlivoUtil( self.testvars['plivo']['auth_id'], self.testvars['plivo']['auth_token'], plivo_phone_number, ) self.call_uuid = self.plivo.make_call( to_number=self.environment.phone_numbers[0].replace('+', '')) call_screen = CallScreen(self.marionette) call_screen.wait_for_incoming_call() self.plivo.hangup_call(self.call_uuid) self.plivo.wait_for_call_completed(self.call_uuid) self.call_uuid = None system = System(self.marionette) self.marionette.switch_to_frame() system.wait_for_notification_toaster_displayed() system.wait_for_notification_toaster_not_displayed() # Open the notification panel system.wait_for_status_bar_displayed() utility_tray = system.open_utility_tray() utility_tray.wait_for_notification_container_displayed() # Verify the user sees the missed call event in the notification center notifications = utility_tray.notifications self.assertEqual(len(notifications), 2) self.assertEqual(notifications[0].title, 'Missed call') # Remove the first digit (country code) which is not displayed for AT&T/USA - Bug 1088756 self.assertTrue(plivo_phone_number[1:] in notifications[0].content) self.assertEqual(notifications[1].title, 'Voicemail') notifications[0].tap_notification() self.marionette.switch_to_frame() system.open_utility_tray() notifications = utility_tray.notifications self.assertEqual(len(notifications), 1) self.assertEqual(notifications[0].title, 'Voicemail')
def test_dialer_miss_call_from_known_contact_notification(self): """ https://moztrap.mozilla.org/manage/case/9294/ """ self.device.lock() from gaiatest.utils.plivo.plivo_util import PlivoUtil self.plivo = PlivoUtil( self.testvars["plivo"]["auth_id"], self.testvars["plivo"]["auth_token"], self.testvars["plivo"]["phone_number"], ) self.call_uuid = self.plivo.make_call(to_number=self.environment.phone_numbers[0].replace("+", "")) call_screen = CallScreen(self.marionette) call_screen.wait_for_incoming_call() self.plivo.hangup_call(self.call_uuid) self.plivo.wait_for_call_completed(self.call_uuid) self.call_uuid = None lock_screen = LockScreen(self.marionette) lock_screen.switch_to_frame() lock_screen.wait_for_notification() # Check if the screen is turned on self.assertTrue(self.device.is_screen_enabled) # Verify the user sees a missed call notification message # and the known contacts info is shown. self.assertTrue(lock_screen.notifications[0].is_visible) self.assertEqual(lock_screen.notifications[0].title, "Missed call") self.assertTrue(self.contact.givenName in lock_screen.notifications[0].content) self.device.unlock() system = System(self.marionette) system.wait_for_notification_toaster_not_displayed() # Expand the notification bar system.wait_for_status_bar_displayed() utility_tray = system.open_utility_tray() utility_tray.wait_for_notification_container_displayed() # Verify the user sees the missed call event in the notification center # and the known contacts info is shown. notifications = utility_tray.notifications self.assertEqual(notifications[0].title, "Missed call") self.assertTrue(self.contact.givenName in notifications[0].content)
class TestUtilityTraySettingsAccessibility(GaiaTestCase): def setUp(self): GaiaTestCase.setUp(self) self.system = System(self.marionette) def test_a11y_utility_tray_settings(self): self.system.wait_for_status_bar_displayed() utility_tray = self.system.open_utility_tray() settings = utility_tray.a11y_click_quick_settings_full_app() # Make sure that Settings is the currently displayed app. Wait(self.marionette).until(lambda m: self.apps.displayed_app.name == settings.name)
class TestUtilityTraySettingsAccessibility(GaiaTestCase): def setUp(self): GaiaTestCase.setUp(self) self.system = System(self.marionette) def test_a11y_utility_tray_settings(self): self.system.wait_for_status_bar_displayed() utility_tray = self.system.open_utility_tray() utility_tray.wait_for_notification_container_displayed() settings = utility_tray.a11y_click_quick_settings_full_app() # Make sure that Settings is the currently displayed app. self.assertEquals(self.apps.displayed_app.name, settings.name)
class TestUtilityTraySettingsAccessibility(GaiaTestCase): def setUp(self): GaiaTestCase.setUp(self) self.system = System(self.marionette) def test_a11y_utility_tray_settings(self): self.system.wait_for_status_bar_displayed() utility_tray = self.system.open_utility_tray() utility_tray.wait_for_notification_container_displayed() settings = utility_tray.a11y_click_quick_settings_full_app() # Make sure that Settings is the currently displayed app. self.assertEquals(self.apps.displayed_app.name, settings.name)
class TestUtilityTrayNotificationsAccessibility(GaiaTestCase): def setUp(self): GaiaTestCase.setUp(self) self.system = System(self.marionette) def test_a11y_utility_tray_notifications(self): self.system.wait_for_status_bar_displayed() utility_tray = self.system.open_utility_tray() self.marionette.execute_script('new Notification("Title", {body: "Body"});') # Assert there is one notification is listed in notifications-container notifications = utility_tray.notifications self.assertEqual(1, len(notifications), 'Expected one notification.') # Clear the notification by "Clear all" utility_tray.a11y_clear_all_notifications() # wait for the notifications to be cleared self.wait_for_condition(lambda m: len(utility_tray.notifications) == 0)
class TestUtilityTrayNotificationsAccessibility(GaiaTestCase): def setUp(self): GaiaTestCase.setUp(self) self.system = System(self.marionette) def test_a11y_utility_tray_notifications(self): self.system.wait_for_status_bar_displayed() utility_tray = self.system.open_utility_tray() self.marionette.execute_script( 'new Notification("Title", {body: "Body"});') # Assert there is one notification is listed in notifications-container notifications = utility_tray.notifications self.assertEqual(1, len(notifications), 'Expected one notification.') # Clear the notification by "Clear all" utility_tray.a11y_clear_all_notifications() # wait for the notifications to be cleared self.wait_for_condition(lambda m: len(utility_tray.notifications) == 0)
def test_notification_bar(self): system = System(self.marionette) # Push a notification self.marionette.execute_script('new Notification("%s", {body: "%s"});' % (self._notification_title, self._notification_body)) system.wait_for_notification_toaster_displayed(for_app='system') system.wait_for_notification_toaster_not_displayed() system.wait_for_status_bar_displayed() utility_tray = system.open_utility_tray() notifications = utility_tray.get_notifications(for_app='system') self.assertEqual(1, len(notifications), 'Expected one system notification.') self.assertEqual(self._notification_body, notifications[0].content) # We cannot disable app update yet so let's wait for it to pass if system.is_app_update_notification_displayed: system.wait_for_app_update_to_clear() utility_tray.clear_all_notifications() self.assertEqual(0, len(utility_tray.notifications))
def test_receive_active_sync_email(self): # setup ActiveSync account email = Email(self.marionette) email.launch() email.setup_active_sync_email(self.environment.email["activesync"]) # wait for sync to complete email.wait_for_emails_to_sync() # Touch home button to exit email app self.device.touch_home_button() # send email to active sync account mock_email = MockEmail(self.environment.host["smtp"]["email"], self.environment.email["activesync"]["email"]) EmailUtil().send(self.environment.host["smtp"], mock_email) self.marionette.switch_to_frame() system = System(self.marionette) # Wait for email notification system.wait_for_notification_toaster_displayed(timeout=60) system.wait_for_notification_toaster_not_displayed() # Expand the notification bar system.wait_for_status_bar_displayed() utility_tray = system.open_utility_tray() utility_tray.wait_for_notification_container_displayed() # Assert there is one notification is listed in notifications-container notifications = utility_tray.notifications self.assertEqual(1, len(notifications), "Expected one notification.") email = notifications[0].tap_notification() self.wait_for_condition(lambda m: self.apps.displayed_app.name == "E-Mail") self.apps.switch_to_displayed_app() # check if the sender's email address is fine self.assertEqual( email.senders_email, mock_email["from"], "Senders's email on the inbox screen is incorrect. " "Expected email is %s. Actual email is %s." % (mock_email["from"], email.senders_email), ) # check if the subject is fine self.assertEqual( email.subject, mock_email["subject"], "Senders's email on the inbox scrseen is incorrect. " "Expected subject is %s. Actual subject is %s." % (mock_email["subject"], email.subject), ) # check if the email message is fine self.assertEqual( email.body, mock_email["message"], "Email message on read email screen is incorrect. " 'Expected message is "%s". Actual message is ' '"%s".' % (mock_email["message"], email.body), )