当前位置: 首页>>代码示例>>Python>>正文


Python Email.setup_active_sync_email方法代码示例

本文整理汇总了Python中gaiatest.apps.email.app.Email.setup_active_sync_email方法的典型用法代码示例。如果您正苦于以下问题:Python Email.setup_active_sync_email方法的具体用法?Python Email.setup_active_sync_email怎么用?Python Email.setup_active_sync_email使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gaiatest.apps.email.app.Email的用法示例。


在下文中一共展示了Email.setup_active_sync_email方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_receive_active_sync_email

# 需要导入模块: from gaiatest.apps.email.app import Email [as 别名]
# 或者: from gaiatest.apps.email.app.Email import setup_active_sync_email [as 别名]
    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))
开发者ID:colinfrei,项目名称:gaia,代码行数:62,代码来源:test_receive_active_sync_email.py

示例2: TestSendActiveSyncEmail

# 需要导入模块: from gaiatest.apps.email.app import Email [as 别名]
# 或者: from gaiatest.apps.email.app.Email import setup_active_sync_email [as 别名]
class TestSendActiveSyncEmail(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.connect_to_network()

        self.email = Email(self.marionette)
        self.email.launch()

        # setup ActiveSync account
        self.email.setup_active_sync_email(
            self.testvars['email']['ActiveSync'])

    def test_send_active_sync_email(self):
        curr_time = repr(time.time()).replace('.', '')
        new_email = self.email.header.tap_compose()

        new_email.type_to(self.testvars['email']['ActiveSync']['email'])
        new_email.type_subject('test email %s' % curr_time)
        new_email.type_body('Lorem ipsum dolor sit amet %s' % curr_time)

        self.email = new_email.tap_send()

        # wait for the email to be sent before we tap refresh
        self.email.wait_for_email('test email %s' % curr_time)

        # assert that the email app subject is in the email list
        self.assertIn('test email %s' % curr_time, [
                      mail.subject for mail in self.email.mails])

        read_email = self.email.mails[0].tap_subject()

        self.assertEqual('Lorem ipsum dolor sit amet %s' %
                         curr_time, read_email.body)
        self.assertEqual('test email %s' % curr_time, read_email.subject)
开发者ID:rwood-moz,项目名称:gaia-ui-tests,代码行数:37,代码来源:test_send_active_sync_email.py

示例3: TestSetupActiveSync

# 需要导入模块: from gaiatest.apps.email.app import Email [as 别名]
# 或者: from gaiatest.apps.email.app.Email import setup_active_sync_email [as 别名]
class TestSetupActiveSync(GaiaTestCase):

    def setUp(self):
        try:
            self.testvars['email']['ActiveSync']
        except KeyError:
            raise SkipTest('account details not present in test variables')

        GaiaTestCase.setUp(self)
        self.connect_to_network()

    def test_setup_active_sync_email(self):
        # setup ActiveSync account

        self.email = Email(self.marionette)
        self.email.launch()

        self.email.setup_active_sync_email(
            self.testvars['email']['ActiveSync'])

        # check header area
        self.assertTrue(self.email.header.is_compose_visible)
        self.assertTrue(self.email.header.is_menu_visible)
        self.assertEqual(self.email.header.label, 'Inbox')

        # check toolbar area
        self.assertTrue(self.email.toolbar.is_edit_visible)
        self.assertTrue(self.email.toolbar.is_refresh_visible)

        # wait for sync to complete
        self.email.wait_for_emails_to_sync()
开发者ID:AaronMT,项目名称:gaia-ui-tests,代码行数:33,代码来源:test_setup_active_sync_email.py

示例4: test_receive_active_sync_email

# 需要导入模块: from gaiatest.apps.email.app import Email [as 别名]
# 或者: from gaiatest.apps.email.app.Email import setup_active_sync_email [as 别名]
    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()

        # 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)

        # wait for the email to arrive
        email.wait_for_email(mock_email.subject)

        # check if the sender's email address is fine
        self.assertEqual(email.mails[0].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.mails[0].senders_email))

        # check if the subject is fine
        self.assertEqual(email.mails[0].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.mails[0].subject))

        # open the email to read it
        email = email.mails[0].tap_subject()

        # 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))
开发者ID:AaronMT,项目名称:gaia-ui-tests,代码行数:58,代码来源:test_receive_active_sync_email.py

示例5: TestSetupAndSendActiveSyncEmail

# 需要导入模块: from gaiatest.apps.email.app import Email [as 别名]
# 或者: from gaiatest.apps.email.app.Email import setup_active_sync_email [as 别名]
class TestSetupAndSendActiveSyncEmail(GaiaTestCase):

    def setUp(self):
        try:
            self.account = self.testvars['email']['ActiveSync']
        except KeyError:
            raise SkipTest('account details not present in test variables')

        GaiaTestCase.setUp(self)
        self.connect_to_local_area_network()

        self.email = Email(self.marionette)
        self.email.launch()

    def test_setup_and_send_active_sync_email(self):
        """
        https://moztrap.mozilla.org/manage/case/2474/
        https://moztrap.mozilla.org/manage/case/2475/
        """
        # setup ActiveSync account
        self.email.setup_active_sync_email(self.account)

        # check header area
        self.assertTrue(self.email.header.is_compose_visible)
        self.assertTrue(self.email.header.is_menu_visible)
        self.assertEqual(self.email.header.label, 'Inbox')

        # check toolbar area
        self.assertTrue(self.email.toolbar.is_edit_visible)
        self.assertTrue(self.email.toolbar.is_refresh_visible)

        # wait for sync to complete
        self.email.wait_for_emails_to_sync()

        curr_time = repr(time.time()).replace('.', '')
        _subject = 's%s' % curr_time
        _body = 'b%s' % curr_time
        new_email = self.email.header.tap_compose()

        new_email.type_to(self.testvars['email']['ActiveSync']['email'])
        new_email.type_subject(_subject)
        new_email.type_body(_body)

        self.email = new_email.tap_send()

        # wait for the email to be sent before we tap refresh
        self.email.wait_for_email(_subject)

        # assert that the email app subject is in the email list
        self.assertIn(_subject, [mail.subject for mail in self.email.mails])

        read_email = self.email.mails[0].tap_subject()

        self.assertEqual(_body, read_email.body)
        self.assertEqual(_subject, read_email.subject)
开发者ID:4gh,项目名称:gaia,代码行数:57,代码来源:test_setup_and_send_active_sync_email.py

示例6: test_receive_active_sync_email

# 需要导入模块: from gaiatest.apps.email.app import Email [as 别名]
# 或者: from gaiatest.apps.email.app.Email import setup_active_sync_email [as 别名]
    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),
        )
开发者ID:kirchner,项目名称:gaia,代码行数:63,代码来源:test_receive_active_sync_email.py


注:本文中的gaiatest.apps.email.app.Email.setup_active_sync_email方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。